Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cached dependencies, typos and debian repos #1732

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

Kondent
Copy link
Contributor

@Kondent Kondent commented Aug 18, 2021

Related issue
#1719

Description

This PR closes #1719.
Few APT errors appear when trying to build test environments for system tests, using Ansible.
This problem seemed to be related with cached dependencies.
Adding these lines to each .yml provisioning file fixed it but one new error was raised.

    update_cache: yes
    cache_valid_time: 3600
fatal: [wazuh-master]: FAILED! => changed=false 
  msg: 'Failed to update apt cache: W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., E:Repository ''http://security.debian.org/debian-security buster/updates InRelease'' changed its ''Suite'' value from ''stable'' to ''oldstable'', 
W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., W:Repository ''http://deb.debian.org/debian buster InRelease'' changed its ''Version'' value from ''10.4'' to ''10.10'', E:Repository ''http://deb.debian.org/debian buster InRelease'' changed its ''Suite'' value from ''stable'' to ''oldstable'', 
W:This must be accepted explicitly before updates for this repository can be applied. 
See apt-secure(8) manpage for details., E:Repository ''http://deb.debian.org/debian buster-updates InRelease'' changed its ''Suite'' value from ''stable-updates'' to ''oldstable-updates'''

Fixed it with a new block inside each .yml file.

- name: "Check and update debian repositories"
  shell:
    cmd: apt-get update --allow-releaseinfo-change

From man pages:

--allow-releaseinfo-change
Allow the update command to continue downloading data from a repository which changed its information of the release contained in the repository indicating e.g a new major release. APT will fail at the update command for such repositories until the change is confirmed to ensure the user is prepared for the change. See also apt-secure(8) for details on the concept and configuration. 

I ran a test after making these changes to be sure everything is working fine (packages and dependencies, etc).

⬦⬦⬦ ~/git/wazuh-qa/tests/system/test_cluster/test_integrity_sync ⊶ fix/1719-cached-dependencies ⨘ pytest -vv test_integrity_sync.py  --disable-warnings 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.5, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /home/kondent/pythonEnv/qa-env/bin/python3.9
cachedir: .pytest_cache
metadata: {'Python': '3.9.5', 'Platform': 'Linux-5.11.0-27-generic-x86_64-with-glibc2.31', 'Packages': {'pytest': '6.2.3', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'html': '3.1.1', 'metadata': '1.11.0', 'testinfra': '5.0.0'}}
rootdir: /home/kondent/git/wazuh-qa/tests/system/test_cluster/test_integrity_sync
plugins: html-3.1.1, metadata-1.11.0, testinfra-5.0.0
collected 4 items                                                                                                                                                                            

test_integrity_sync.py::test_missing_file PASSED                                                                                                                                       [ 25%]
test_integrity_sync.py::test_shared_files PASSED                                                                                                                                       [ 50%]
test_integrity_sync.py::test_extra_files PASSED                                                                                                                                        [ 75%]
test_integrity_sync.py::test_extra_valid_files PASSED                                                                                                                                  [100%]

=============================================================================== 4 passed in 367.45s (0:06:07) ================================================================================

Regards,
Alexis

@Kondent Kondent self-assigned this Aug 18, 2021
@juliamagan
Copy link
Member

juliamagan commented Sep 1, 2021

Testing changes in provisioning/enrollment_cluster I got:

R1 R2 R3
🔴 🔴 🔴

These tests failed due to the environment.

@Rebits
Copy link
Member

Rebits commented Sep 1, 2021

This fix seems to work perfectly.


test_agent_enrollment Report
R1 🟢
R2 🟢
R3 🟢

test_agent_info_sync Report
R1 🟢
R2 🟢
R3 🟢

test_agent_key_polling Report
R1 🟠
R2 🟠
R3 🟠

test_integrity_sync Report
R1 🟢
R2 🟢
R3 🟢

test_jwt_invalidation Report
R1 🟢
R2 🟢
R3 🟢

Copy link
Member

@Rebits Rebits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snaow snaow merged commit 194e2ec into master Sep 2, 2021
@snaow snaow deleted the fix/1719-cached-dependencies branch September 2, 2021 08:00
@snaow snaow mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in cached dependencies for Ansible system environments
5 participants