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

Fixed GHA test for Wazuh indexer upgrade #2463

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

rauldpm
Copy link
Member

@rauldpm rauldpm commented Sep 18, 2023

Related issue
Closes #2429

Description

This pull request fixes the Wazuh indexer update test since the files were not being modified correctly by not correctly redirecting to the tested file

Logs example

Upgrade from 4.5.2 to 4.6.0
[root@centos7 vagrant]# bash upgrade-indexer.sh "wazuh-indexer-4.6.0-1.x86_64.rpm" "45"
New path detected (/etc).
Installing old version of Wazuh indexer...
[wazuh]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=EL-$releasever - Wazuh
baseurl=https://packages.wazuh.com/4.x/yum/
protect=1
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * extras: mirror.tedra.es
 * updates: mirror.tedra.es
wazuh                                                                                                                                                                                                                 | 3.4 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package wazuh-indexer.x86_64 0:4.5.2-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                       Arch                                                   Version                                                    Repository                                             Size
=============================================================================================================================================================================================================================================
Installing:
 wazuh-indexer                                                 x86_64                                                 4.5.2-1                                                    wazuh                                                 675 M

Transaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 675 M
Installed size: 931 M
Downloading packages:
wazuh-indexer-4.5.2-1.x86_64.rpm                                                                                                                                                                                      | 675 MB  00:00:08     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wazuh-indexer-4.5.2-1.x86_64                                                                                                                                                                                              1/1 
Created opensearch keystore in /etc/wazuh-indexer/opensearch.keystore
  Verifying  : wazuh-indexer-4.5.2-1.x86_64                                                                                                                                                                                              1/1 

Installed:
  wazuh-indexer.x86_64 0:4.5.2-1                                                                                                                                                                                                             

Complete!
Processing /etc/wazuh-indexer/opensearch-security/action_groups.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/allowlist.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/audit.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/config.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/internal_users.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/nodes_dn.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/opensearch.yml.example file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/roles_mapping.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/roles.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/tenants.yml file...
Changed file.
Processing /etc/wazuh-indexer/opensearch-security/whitelist.yml file...
Changed file.
Old files...
Key: roles_mapping.yml
Value: 1deff102040f596a229b018dd343ce7c
Key: action_groups.yml
Value: 56c06718658b8482b3b7abdb52518258
Key: internal_users.yml
Value: beda21e0405bbcc4b1cfd9d0d1cad015
Key: config.yml
Value: d75cbb1b7c0e299db6afe067896c069d
Key: nodes_dn.yml
Value: 28225dd9b9d5c8590e2924ee6561be68
Key: opensearch.yml.example
Value: b6624309707a7ac4a6a45c71c292740f
Key: tenants.yml
Value: c7a153b0df3182be5b30bf3f8592105a
Key: allowlist.yml
Value: ca5887d86e22ce83df32101212d42034
Key: roles.yml
Value: c4bc5a893515fe12944d6910a32c53b9
Key: audit.yml
Value: 56c1c1d37c5a868b1c5bb458b890f59b
Key: whitelist.yml
Value: 5c265da3f9bb6845a712b0f5fe2d7d04
Installing new version of Wazuh indexer...
Loaded plugins: fastestmirror
Examining wazuh-indexer-4.6.0-1.x86_64.rpm: wazuh-indexer-4.6.0-1.x86_64
Marking wazuh-indexer-4.6.0-1.x86_64.rpm as an update to wazuh-indexer-4.5.2-1.x86_64
Resolving Dependencies
--> Running transaction check
---> Package wazuh-indexer.x86_64 0:4.5.2-1 will be updated
---> Package wazuh-indexer.x86_64 0:4.6.0-1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                 Arch                                             Version                                              Repository                                                               Size
=============================================================================================================================================================================================================================================
Updating:
 wazuh-indexer                                           x86_64                                           4.6.0-1                                              /wazuh-indexer-4.6.0-1.x86_64                                           930 M

Transaction Summary
=============================================================================================================================================================================================================================================
Upgrade  1 Package

Total size: 930 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : wazuh-indexer-4.6.0-1.x86_64                                                                                                                                                                                              1/2 
warning: /etc/wazuh-indexer/opensearch-security/config.yml created as /etc/wazuh-indexer/opensearch-security/config.yml.rpmnew
  Cleanup    : wazuh-indexer-4.5.2-1.x86_64                                                                                                                                                                                              2/2 
  Verifying  : wazuh-indexer-4.6.0-1.x86_64                                                                                                                                                                                              1/2 
  Verifying  : wazuh-indexer-4.5.2-1.x86_64                                                                                                                                                                                              2/2 

Updated:
  wazuh-indexer.x86_64 0:4.6.0-1                                                                                                                                                                                                             

Complete!
Processing /etc/wazuh-indexer/opensearch-security/action_groups.yml file...
Processing /etc/wazuh-indexer/opensearch-security/allowlist.yml file...
Processing /etc/wazuh-indexer/opensearch-security/audit.yml file...
Processing /etc/wazuh-indexer/opensearch-security/config.yml file...
Processing /etc/wazuh-indexer/opensearch-security/config.yml.rpmnew file...
Processing /etc/wazuh-indexer/opensearch-security/internal_users.yml file...
Processing /etc/wazuh-indexer/opensearch-security/nodes_dn.yml file...
Processing /etc/wazuh-indexer/opensearch-security/opensearch.yml.example file...
Processing /etc/wazuh-indexer/opensearch-security/roles_mapping.yml file...
Processing /etc/wazuh-indexer/opensearch-security/roles.yml file...
Processing /etc/wazuh-indexer/opensearch-security/tenants.yml file...
Processing /etc/wazuh-indexer/opensearch-security/whitelist.yml file...
New files...
Key: roles_mapping.yml
Value: 1deff102040f596a229b018dd343ce7c
Key: action_groups.yml
Value: 56c06718658b8482b3b7abdb52518258
Key: internal_users.yml
Value: beda21e0405bbcc4b1cfd9d0d1cad015
Key: config.yml
Value: d75cbb1b7c0e299db6afe067896c069d
Key: config.yml.rpmnew
Value: 25c499973687a8fd3eb8b9ceb3da7a68
Key: nodes_dn.yml
Value: 28225dd9b9d5c8590e2924ee6561be68
Key: opensearch.yml.example
Value: b6624309707a7ac4a6a45c71c292740f
Key: tenants.yml
Value: c7a153b0df3182be5b30bf3f8592105a
Key: allowlist.yml
Value: ca5887d86e22ce83df32101212d42034
Key: roles.yml
Value: c4bc5a893515fe12944d6910a32c53b9
Key: audit.yml
Value: 56c1c1d37c5a868b1c5bb458b890f59b
Key: whitelist.yml
Value: 5c265da3f9bb6845a712b0f5fe2d7d04
Comparing roles_mapping.yml file checksum...
Old: 1deff102040f596a229b018dd343ce7c
New: 1deff102040f596a229b018dd343ce7c
roles_mapping.yml - Same checksum.
Comparing action_groups.yml file checksum...
Old: 56c06718658b8482b3b7abdb52518258
New: 56c06718658b8482b3b7abdb52518258
action_groups.yml - Same checksum.
Comparing internal_users.yml file checksum...
Old: beda21e0405bbcc4b1cfd9d0d1cad015
New: beda21e0405bbcc4b1cfd9d0d1cad015
internal_users.yml - Same checksum.
Comparing config.yml file checksum...
Old: d75cbb1b7c0e299db6afe067896c069d
New: d75cbb1b7c0e299db6afe067896c069d
config.yml - Same checksum.
Comparing opensearch.yml.example file checksum...
Old: b6624309707a7ac4a6a45c71c292740f
New: b6624309707a7ac4a6a45c71c292740f
opensearch.yml.example - Same checksum.
Comparing nodes_dn.yml file checksum...
Old: 28225dd9b9d5c8590e2924ee6561be68
New: 28225dd9b9d5c8590e2924ee6561be68
nodes_dn.yml - Same checksum.
Comparing tenants.yml file checksum...
Old: c7a153b0df3182be5b30bf3f8592105a
New: c7a153b0df3182be5b30bf3f8592105a
tenants.yml - Same checksum.
Comparing allowlist.yml file checksum...
Old: ca5887d86e22ce83df32101212d42034
New: ca5887d86e22ce83df32101212d42034
allowlist.yml - Same checksum.
Comparing roles.yml file checksum...
Old: c4bc5a893515fe12944d6910a32c53b9
New: c4bc5a893515fe12944d6910a32c53b9
roles.yml - Same checksum.
Comparing audit.yml file checksum...
Old: 56c1c1d37c5a868b1c5bb458b890f59b
New: 56c1c1d37c5a868b1c5bb458b890f59b
audit.yml - Same checksum.
Comparing whitelist.yml file checksum...
Old: 5c265da3f9bb6845a712b0f5fe2d7d04
New: 5c265da3f9bb6845a712b0f5fe2d7d04
whitelist.yml - Same checksum.
Same checksums - Test passed correctly.

GHA

@fcaffieri fcaffieri merged commit 50222ea into 4.6.0 Sep 18, 2023
6 checks passed
@fcaffieri fcaffieri deleted the bug/2429-fix-indexer-gha-4.6.0 branch September 18, 2023 17:07
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.

Ugrading wazuh-indexer from 4.5 to 4.6 modifies config.yml file
2 participants