Skip to content

Commit

Permalink
Dev: behave: add functional tests for previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Sep 23, 2024
1 parent 508068f commit 035aeec
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/crmsh-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,22 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration

functional_test_healthcheck:
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: functional test for healthcheck
run: |
echo '{ "exec-opts": ["native.cgroupdriver=systemd"] }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker.service
index=`$GET_INDEX_OF healthcheck`
$DOCKER_SCRIPT $index && $DOCKER_SCRIPT -d && $DOCKER_SCRIPT $index -u
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration

functional_test_cluster_api:
runs-on: ubuntu-24.04
timeout-minutes: 40
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ coverage:
threshold: 0.35%
codecov:
notify:
after_n_builds: 27
after_n_builds: 28
comment:
after_n_builds: 27
after_n_builds: 28
layout: "condensed_header, flags, files, condensed_footer"
1 change: 1 addition & 0 deletions data-manifest
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ test/features/crm_report_bugs.feature
test/features/crm_report_normal.feature
test/features/environment.py
test/features/geo_setup.feature
test/features/healthcheck.feature
test/features/ocfs2.feature
test/features/qdevice_options.feature
test/features/qdevice_setup_remove.feature
Expand Down
30 changes: 30 additions & 0 deletions test/features/healthcheck.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@healthcheck
Feature: healthcheck detect and fix problems in a crmsh deployment

Tag @clean means need to stop cluster service if the service is available
Need nodes: hanode1 hanode2 hanode3

Background: Setup a two nodes cluster
Given Cluster service is "stopped" on "hanode1"
And Cluster service is "stopped" on "hanode2"
And Cluster service is "stopped" on "hanode3"
When Run "crm cluster init -y" on "hanode1"
Then Cluster service is "started" on "hanode1"
And Show cluster status on "hanode1"
When Run "crm cluster join -c hanode1 -y" on "hanode2"
Then Cluster service is "started" on "hanode2"
And Online nodes are "hanode1 hanode2"
And Show cluster status on "hanode1"

@clean
Scenario: An upgrade_seq file in ~hacluster/crmsh/ will be migrated to /var/lib/crmsh (bsc#1213050)
When Run "rm -rf ~hacluster/.ssh" on "hanode1"
And Try "crm cluster health hawk2" on "hanode1"
Then Expected "hawk2: passwordless ssh authentication: FAIL." in stderr
When Run "crm cluster health hawk2 --fix" on "hanode1"
Then Expected "hawk2: passwordless ssh authentication: OK." in stdout
When Run "rm -rf ~hacluster/.ssh /root/.config/crm" on "hanode1"
And Try "crm cluster health hawk2" on "hanode1"
Then Expected "hawk2: passwordless ssh authentication: FAIL." in stderr
When Try "crm cluster health hawk2 --fix" on "hanode1"
Then Expected "Cannot fix automatically" in stderr

0 comments on commit 035aeec

Please sign in to comment.