Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: behave: Change in functional test for previous crm report changes
Browse files Browse the repository at this point in the history
liangxin1300 committed Nov 2, 2021
1 parent 8c31a4a commit 8e08f7e
Showing 6 changed files with 24 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/crmsh-ci.yml
Original file line number Diff line number Diff line change
@@ -37,15 +37,15 @@ jobs:
run: |
tox -v
functional_test_hb_report_bugs:
functional_test_crm_report_bugs:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: functional test for hb_report
- name: functional test for crm_report
run: |
$DOCKER_SCRIPT hb_report before_install
$DOCKER_SCRIPT hb_report run bugs
$DOCKER_SCRIPT crm_report before_install
$DOCKER_SCRIPT crm_report run bugs
functional_test_bootstrap_bugs:
runs-on: ubuntu-latest
@@ -169,7 +169,7 @@ jobs:
delivery:
needs: [unit_test,
functional_test_hb_report_bugs,
functional_test_crm_report_bugs,
functional_test_bootstrap_bugs,
functional_test_bootstrap_common,
functional_test_bootstrap_options,
5 changes: 2 additions & 3 deletions data-manifest
Original file line number Diff line number Diff line change
@@ -71,9 +71,9 @@ test/features/bootstrap_options.feature
test/features/bootstrap_sbd.feature
test/features/configure_bugs.feature
test/features/constraints_bugs.feature
test/features/crm_report_bugs.feature
test/features/environment.py
test/features/geo_setup.feature
test/features/hb_report_bugs.feature
test/features/ocfs2.feature
test/features/qdevice_options.feature
test/features/qdevice_setup_remove.feature
@@ -194,9 +194,8 @@ test/unittests/test_objset.py
test/unittests/test_ocfs2.py
test/unittests/test_parallax.py
test/unittests/test_parse.py
test/unittests/test_ratrace.py
test/unittests/test_qdevice.py
test/unittests/test_report.py
test/unittests/test_ratrace.py
test/unittests/test_sbd.py
test/unittests/test_scripts.py
test/unittests/test_time.py
4 changes: 2 additions & 2 deletions test/docker_scripts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
Docker_image='liangxin1300/haleap:15.2'
HA_packages='pacemaker corosync corosync-qdevice'
TEST_TYPE='bootstrap qdevice hb_report geo'
TEST_TYPE='bootstrap qdevice crm_report geo'

etc_hosts_content=`cat <<EOF
10.10.10.2 hanode1
@@ -61,7 +61,7 @@ usage() {
}
# $1 could be "bootstrap", "hb_report", "qdevice" etc.
# $1 could be "bootstrap", "crm_report", "qdevice" etc.
# $2 could be "before_install" or "run"
# $3 could be suffix of feature file
case "$1/$2" in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@hb_report
Feature: hb_report functional test for verifying bugs
@crm_report
Feature: crm report functional test for verifying bugs

Tag @clean means need to stop cluster service if the service is available

@@ -28,7 +28,7 @@ Feature: hb_report functional test for verifying bugs
Sep 08 09:37:02 node1 log message line4
Sep 08 09:37:12 node1 log message line5
"""
And Run "hb_report -f 20200901 -E /var/log/log1 report1" on "hanode1"
And Run "crm report -f 20200901 -E /var/log/log1 report1" on "hanode1"
Then File "log1" in "report1.tar.bz2"
When Run "tar jxf report1.tar.bz2" on "hanode1"
And Run "cat report1/hanode1/log1" on "hanode1"
@@ -45,15 +45,15 @@ Feature: hb_report functional test for verifying bugs
@clean
Scenario: Collect corosync.log(bsc#1148874)
When Run "sed -i 's/\(\s+logfile:\s+\).*/\1\/var\/log\/cluster\/corosync.log/' /etc/corosync/corosync.conf" on "hanode1"
And Run "hb_report report" on "hanode1"
And Run "crm report report" on "hanode1"
And Run "tar jxf report.tar.bz2" on "hanode1"
Then File "corosync.log" not in "report.tar.bz2"
When Run "rm -rf report.tar.gz report" on "hanode1"

When Run "sed -i 's/\(\s*to_logfile:\s*\).*/\1yes/' /etc/corosync/corosync.conf" on "hanode1"
And Run "crm cluster stop" on "hanode1"
And Run "crm cluster start" on "hanode1"
And Run "hb_report report" on "hanode1"
And Run "crm report report" on "hanode1"
And Run "tar jxf report.tar.bz2" on "hanode1"
Then File "corosync.log" in "report.tar.bz2"
When Run "rm -rf report.tar.bz2 report" on "hanode1"
@@ -63,10 +63,10 @@ Feature: hb_report functional test for verifying bugs
# Set sensitive data TEL and password
When Run "crm node utilization hanode1 set TEL 13356789876" on "hanode1"
When Run "crm node utilization hanode1 set password qwertyui" on "hanode1"
When Run "hb_report report" on "hanode1"
When Run "crm report report" on "hanode1"
When Run "tar jxf report.tar.bz2" on "hanode1"
And Try "grep -R "qwertyui" report"
# hb_report mask passw.* by default
# crm report mask passw.* by default
# No password here
Then Expected return code is "1"
When Run "rm -rf report.tar.bz2 report" on "hanode1"
@@ -75,15 +75,15 @@ Feature: hb_report functional test for verifying bugs
When Run "crm configure primitive ip2 IPaddr2 params ip=10.10.10.124" on "hanode1"
And Run "sed -i 's/; \[report\]/[report]/' /etc/crm/crm.conf" on "hanode1"
And Run "sed -i 's/; sanitize_rule = .*$/sanitize_rule = passw.*|ip.*:raw/g' /etc/crm/crm.conf" on "hanode1"
And Run "hb_report report" on "hanode1"
And Run "crm report report" on "hanode1"
And Run "tar jxf report.tar.bz2" on "hanode1"
And Try "grep -R -E "10.10.10.124|qwertyui" report"
# No password here
Then Expected return code is "1"
When Run "rm -rf report.tar.bz2 report" on "hanode1"

# Do sanitize job, also for TEL
When Run "hb_report -s -p TEL report" on "hanode1"
When Run "crm report -s -p TEL report" on "hanode1"
When Run "tar jxf report.tar.bz2" on "hanode1"
And Try "grep -R "qwertyui" report"
# No password here
@@ -96,7 +96,7 @@ Feature: hb_report functional test for verifying bugs
# disable sanitize
When Run "sed -i 's/; \[report\]/[report]/' /etc/crm/crm.conf" on "hanode1"
And Run "sed -i 's/sanitize_rule = .*$/sanitize_rule = /g' /etc/crm/crm.conf" on "hanode1"
When Run "hb_report report" on "hanode1"
When Run "crm report report" on "hanode1"
When Run "tar jxf report.tar.bz2" on "hanode1"
And Try "grep -R "qwertyui" report"
# found password
8 changes: 4 additions & 4 deletions test/features/steps/step_implenment.py
Original file line number Diff line number Diff line change
@@ -268,15 +268,15 @@ def step_impl(context, votes):
assert int(corosync.get_value("quorum.expected_votes")) == int(votes)


@then('Default hb_report tar file created')
@then('Default crm_report tar file created')
def step_impl(context):
default_file_name = 'hb_report-{}.tar.bz2'.format(datetime.datetime.now().strftime("%w-%d-%m-%Y"))
default_file_name = 'crm_report-{}.tar.bz2'.format(datetime.datetime.now().strftime("%w-%d-%m-%Y"))
assert os.path.exists(default_file_name) is True


@when('Remove default hb_report tar file')
@when('Remove default crm_report tar file')
def step_impl(context):
default_file_name = 'hb_report-{}.tar.bz2'.format(datetime.datetime.now().strftime("%w-%d-%m-%Y"))
default_file_name = 'crm_report-{}.tar.bz2'.format(datetime.datetime.now().strftime("%w-%d-%m-%Y"))
os.remove(default_file_name)


2 changes: 1 addition & 1 deletion test/run-in-travis.sh
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ case "$1" in
configure
make_install
exit $?;;
bootstrap|qdevice|hb_report|resource|geo|configure|constraints|ocfs2)
bootstrap|qdevice|crm_report|resource|geo|configure|constraints|ocfs2)
functional_tests $1 $2
exit $?;;
*|original)

0 comments on commit 8e08f7e

Please sign in to comment.