diff --git a/Makefile b/Makefile index bd04c1f6e..bc26fd37d 100644 --- a/Makefile +++ b/Makefile @@ -126,25 +126,25 @@ copy-files: install -m 644 srv/salt/ceph/tests/restart/rgw/nochange/*.sls $(DESTDIR)/srv/salt/ceph/tests/restart/rgw/nochange install -m 644 srv/salt/ceph/tests/tuned/*.sls $(DESTDIR)/srv/salt/ceph/tests/tuned install -m 644 srv/salt/ceph/tests/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/tests/tuned/off - # smoketests - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests - install -m 644 srv/salt/ceph/smoketests/*.sls $(DESTDIR)/srv/salt/ceph/smoketests - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/apparmor - install -m 644 srv/salt/ceph/smoketests/apparmor/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/apparmor - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/keyrings - install -m 644 srv/salt/ceph/smoketests/keyrings/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/keyrings - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/macros - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/macros/os_switch - install -m 644 srv/salt/ceph/smoketests/macros/os_switch/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/macros/os_switch - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/openstack - install -m 644 srv/salt/ceph/smoketests/openstack/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/openstack - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/quiescent - install -m 644 srv/salt/ceph/smoketests/quiescent/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/quiescent - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/restart - install -m 644 srv/salt/ceph/smoketests/restart/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/restart - install -d -m 755 $(DESTDIR)/srv/salt/ceph/smoketests/tuned/off - install -m 644 srv/salt/ceph/smoketests/tuned/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/tuned - install -m 644 srv/salt/ceph/smoketests/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/smoketests/tuned/off + # functests/1node + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node + install -m 644 srv/salt/ceph/functests/1node/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/apparmor + install -m 644 srv/salt/ceph/functests/1node/apparmor/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/apparmor + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/keyrings + install -m 644 srv/salt/ceph/functests/1node/keyrings/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/keyrings + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/macros + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/macros/os_switch + install -m 644 srv/salt/ceph/functests/1node/macros/os_switch/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/macros/os_switch + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/openstack + install -m 644 srv/salt/ceph/functests/1node/openstack/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/openstack + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/quiescent + install -m 644 srv/salt/ceph/functests/1node/quiescent/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/quiescent + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/restart + install -m 644 srv/salt/ceph/functests/1node/restart/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/restart + install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/tuned/off + install -m 644 srv/salt/ceph/functests/1node/tuned/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/tuned + install -m 644 srv/salt/ceph/functests/1node/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/tuned/off # docs install -d -m 755 $(DESTDIR)$(DOCDIR)/deepsea install -m 644 LICENSE $(DESTDIR)$(DOCDIR)/deepsea/ diff --git a/deepsea.spec.in b/deepsea.spec.in index de977ed8a..768499102 100644 --- a/deepsea.spec.in +++ b/deepsea.spec.in @@ -745,16 +745,17 @@ the README for more information. %files qa %{_libexecdir}/deepsea/qa -%dir /srv/salt/ceph/smoketests -%dir /srv/salt/ceph/smoketests/apparmor -%dir /srv/salt/ceph/smoketests/keyrings -%dir /srv/salt/ceph/smoketests/macros -%dir /srv/salt/ceph/smoketests/macros/os_switch -%dir /srv/salt/ceph/smoketests/openstack -%dir /srv/salt/ceph/smoketests/quiescent -%dir /srv/salt/ceph/smoketests/restart -%dir /srv/salt/ceph/smoketests/tuned -%dir /srv/salt/ceph/smoketests/tuned/off +%dir /srv/salt/ceph/functests +%dir /srv/salt/ceph/functests/1node +%dir /srv/salt/ceph/functests/1node/apparmor +%dir /srv/salt/ceph/functests/1node/keyrings +%dir /srv/salt/ceph/functests/1node/macros +%dir /srv/salt/ceph/functests/1node/macros/os_switch +%dir /srv/salt/ceph/functests/1node/openstack +%dir /srv/salt/ceph/functests/1node/quiescent +%dir /srv/salt/ceph/functests/1node/restart +%dir /srv/salt/ceph/functests/1node/tuned +%dir /srv/salt/ceph/functests/1node/tuned/off %dir /srv/salt/ceph/tests %dir /srv/salt/ceph/tests/keyrings %dir /srv/salt/ceph/tests/openstack @@ -780,17 +781,17 @@ the README for more information. %dir /srv/salt/ceph/tests/restart/rgw/change %dir /srv/salt/ceph/tests/restart/rgw/forced %dir /srv/salt/ceph/tests/restart/rgw/nochange -/srv/salt/ceph/smoketests/*.sls -/srv/salt/ceph/smoketests/apparmor/*.sls +/srv/salt/ceph/functests/1node/*.sls +/srv/salt/ceph/functests/1node/apparmor/*.sls %dir /srv/salt/ceph/tests/tuned %dir /srv/salt/ceph/tests/tuned/off -/srv/salt/ceph/smoketests/keyrings/*.sls -/srv/salt/ceph/smoketests/macros/os_switch/*.sls -/srv/salt/ceph/smoketests/openstack/*.sls -/srv/salt/ceph/smoketests/quiescent/*.sls -/srv/salt/ceph/smoketests/restart/*.sls -/srv/salt/ceph/smoketests/tuned/*.sls -/srv/salt/ceph/smoketests/tuned/off/*.sls +/srv/salt/ceph/functests/1node/keyrings/*.sls +/srv/salt/ceph/functests/1node/macros/os_switch/*.sls +/srv/salt/ceph/functests/1node/openstack/*.sls +/srv/salt/ceph/functests/1node/quiescent/*.sls +/srv/salt/ceph/functests/1node/restart/*.sls +/srv/salt/ceph/functests/1node/tuned/*.sls +/srv/salt/ceph/functests/1node/tuned/off/*.sls /srv/salt/ceph/tests/keyrings/*.sls /srv/salt/ceph/tests/openstack/*.sls /srv/salt/ceph/tests/os_switch/*.sls diff --git a/qa/common/common.sh b/qa/common/common.sh index e3d791fd7..ffc12be77 100644 --- a/qa/common/common.sh +++ b/qa/common/common.sh @@ -205,51 +205,6 @@ mgr initial modules = dashboard EOF } -# -# functions for testing ceph.restart orchestration -# - -function restart_services { - rm -rf /srv/modules/runners/__pycache__ - salt-run state.orch ceph.restart -} - -function mon_restarted { - local expected_return=$1 - local mon_hosts=$(salt --static --out json -C "I@roles:mon" test.ping | jq -r 'keys[]') - set +e - for minion in ${mon_hosts}; do - salt "${minion}*" cmd.shell "journalctl -u ceph-mon@*" | grep -i terminated - test $? = ${expected_return} - done - set -e -} - -function osd_restarted { - local expected_return=$1 - osd_hosts=$(salt --static --out json -C "I@roles:storage" test.ping | jq -r 'keys[]') - set +e - for host in ${osd_hosts}; do - osds=$(salt --static --out json ${host} osd.list | jq .[][]) - for osd in ${osds}; do - salt ${host} cmd.shell "journalctl -u ceph-osd@${osd}" | grep -i terminated - test $? = ${expected_return} - done - done - set -e -} - -function rgw_restarted { - local expected_return=$1 - rgw_hosts=$(salt --static --out json -C "I@roles:rgw" test.ping | jq -r 'keys[]') - set +e - for host in ${rgw_hosts}; do - salt ${host} cmd.shell "journalctl -u ceph-radosgw@*" | grep -i terminated - test $? = ${expected_return} - done - set -e -} - # # functions for creating pools @@ -342,11 +297,13 @@ function ceph_version_test { rpm -q ceph local RPM_NAME=$(rpm -q ceph) local RPM_CEPH_VERSION=$(perl -e '"'"$RPM_NAME"'" =~ m/ceph-(\d+\.\d+\.\d+)/; print "$1\n";') - echo "According to RPM, the ceph upstream version is $RPM_CEPH_VERSION" + echo "According to RPM, the ceph upstream version is ->$RPM_CEPH_VERSION<-" + test -n "$RPM_CEPH_VERSION" ceph --version local BUFFER=$(ceph --version) local CEPH_CEPH_VERSION=$(perl -e '"'"$BUFFER"'" =~ m/ceph version (\d+\.\d+\.\d+)/; print "$1\n";') - echo "According to \"ceph --version\", the ceph upstream version is $CEPH_CEPH_VERSION" + echo "According to \"ceph --version\", the ceph upstream version is ->$CEPH_CEPH_VERSION<-" + test -n "$RPM_CEPH_VERSION" test "$RPM_CEPH_VERSION" = "$CEPH_CEPH_VERSION" } diff --git a/qa/common/deploy.sh b/qa/common/deploy.sh index a3ec630c9..4b8b124c8 100644 --- a/qa/common/deploy.sh +++ b/qa/common/deploy.sh @@ -51,7 +51,7 @@ function vet_nodes { } function ceph_cluster_running { - ceph status 2>&1 >/dev/null + ceph status >/dev/null 2>&1 } function deploy_ceph { diff --git a/qa/common/helper.sh b/qa/common/helper.sh index a76f0ab4a..a8a073c44 100644 --- a/qa/common/helper.sh +++ b/qa/common/helper.sh @@ -19,15 +19,6 @@ function _report_stage_failure_and_die { function _run_stage { local stage_num=$1 - local cli=$2 - test -z "$cli" && cli="classic" - local stage_log_path="/tmp/stage.${stage_num}.log" - local deepsea_cli_output_path="/tmp/deepsea.${stage_num}.log" - local deepsea_exit_status="" - - # workaround for https://bugzilla.suse.com/show_bug.cgi?id=1087232 - # delete Salt runner __pycache__ - rm -rf /srv/modules/runners/__pycache__ set +x echo "" @@ -37,34 +28,44 @@ function _run_stage { set -x # CLI case - if [ "x$cli" = "xcli" ] ; then - echo "using DeepSea CLI" - set +e - deepsea \ - --log-file=/var/log/salt/deepsea.log \ - --log-level=debug \ - stage \ - run \ - ceph.stage.${stage_num} \ - --simple-output \ - 2>&1 | tee $deepsea_cli_output_path - deepsea_exit_status="${PIPESTATUS[0]}" - echo "deepsea exit status: $deepsea_exit_status" - if [ "$deepsea_exit_status" = "0" ] ; then - if grep -q -F "failed=0" $deepsea_cli_output_path ; then - echo "DeepSea stage OK" - else - echo "ERROR: deepsea stage returned exit status 0, yet one or more steps failed. Bailing out!" - _report_stage_failure_and_die $stage_num - fi + test -n "$CLI" && _run_stage_cli $stage_num || _run_stage_non_cli $stage_num +} + +function _run_stage_cli { + local stage_num=$1 + local deepsea_cli_output_path="/tmp/deepsea.${stage_num}.log" + local deepsea_exit_status="" + + echo "using DeepSea CLI" + set +e + deepsea \ + --log-file=/var/log/salt/deepsea.log \ + --log-level=debug \ + stage \ + run \ + ceph.stage.${stage_num} \ + --simple-output \ + 2>&1 | tee $deepsea_cli_output_path + deepsea_exit_status="${PIPESTATUS[0]}" + echo "deepsea exit status: $deepsea_exit_status" + echo "WWWW" + if [ "$deepsea_exit_status" = "0" ] ; then + if grep -q -F "failed=0" $deepsea_cli_output_path ; then + echo "********** Stage $stage_num completed successfully **********" else + echo "ERROR: deepsea stage returned exit status 0, yet one or more steps failed. Bailing out!" _report_stage_failure_and_die $stage_num fi - set -e - return + else + _report_stage_failure_and_die $stage_num fi + set -e +} + +function _run_stage_non_cli { + local stage_num=$1 + local stage_log_path="/tmp/stage.${stage_num}.log" - # non-CLI ("classic") case echo -n "" > $stage_log_path salt-run --no-color state.orch ceph.stage.${stage_num} 2>&1 | tee $stage_log_path STAGE_FINISHED=$(grep -F 'Total states run' $stage_log_path) diff --git a/qa/common/policy.sh b/qa/common/policy.sh index 1e7239fd0..4b7852d51 100644 --- a/qa/common/policy.sh +++ b/qa/common/policy.sh @@ -83,14 +83,26 @@ EOF else echo "Unexpected number of client nodes ->$CLIENT_NODES<-; bailing out!" exit 1 - fi + fi } function policy_cfg_mds { - cat <> /srv/pillar/ceph/proposals/policy.cfg -# Role assignment - mds (all but last node) -role-mds/cluster/*.sls slice=[:-1] + test -n "$CLIENT_NODES" + + if [ "$CLIENT_NODES" -eq 0 ] ; then + cat <> /srv/pillar/ceph/proposals/policy.cfg +# Role assignment - mds (all nodes) +role-mds/cluster/*.sls EOF + elif [ "$CLIENT_NODES" -ge 1 ] ; then + cat <> /srv/pillar/ceph/proposals/policy.cfg +# Role assignment - mds (all non-client nodes) +role-mds/cluster/*.sls slice=[:-$CLIENT_NODES] +EOF + else + echo "Unexpected number of client nodes ->$CLIENT_NODES<-; bailing out!" + exit 1 + fi } function policy_cfg_rgw { diff --git a/qa/suites/basic/health-mds.sh b/qa/suites/basic/health-mds.sh deleted file mode 100755 index 02d873b85..000000000 --- a/qa/suites/basic/health-mds.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# DeepSea integration test "suites/basic/health-mds.sh" -# -# This script runs DeepSea stages 0-4 to deploy a Ceph cluster with MDS. -# After stage 4 completes, it mounts the cephfs on the client node, -# touches a file, and asserts that it exists. -# -# The script makes no assumptions beyond those listed in qa/README. -# -# On success, the script returns 0. On failure, for whatever reason, the script -# returns non-zero. -# -# The script produces verbose output on stdout, which can be captured for later -# forensic analysis. -# - -set -ex - -SCRIPTNAME=$(basename ${0}) -BASEDIR=$(readlink -f "$(dirname ${0})/../..") -test -d $BASEDIR -[[ $BASEDIR =~ \/qa$ ]] - -source $BASEDIR/common/common.sh - -function usage { - set +x - echo "$SCRIPTNAME - script for testing CephFS deployment" - echo "for use in SUSE Enterprise Storage testing" - echo - echo "Usage:" - echo " $SCRIPTNAME [-h,--help] [--cli] [--mini]" - echo - echo "Options:" - echo " --cli Use DeepSea CLI" - echo " --help Display this usage message" - echo " --mini Omit long-running tests" - exit 1 -} - -TEMP=$(getopt -o h --long "cli,help,mini,smoke" \ - -n 'health-mds.sh' -- "$@") - -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi - -# Note the quotes around TEMP': they are essential! -eval set -- "$TEMP" - -# process options -CLI="" -MINI="" -while true ; do - case "$1" in - --cli) CLI="$1" ; shift ;; - -h|--help) usage ;; # does not return - --mini|--smoke) MINI="$1" ; shift ;; - --) shift ; break ;; - *) echo "Internal error" ; exit 1 ;; - esac -done - -# deploy phase -MIN_NODES=2 -CLIENT_NODES=1 -STORAGE_PROFILE="default" -MDS="--mds" -deploy_ceph - -# test phase -ceph_health_test -cephfs_mount_and_sanity_test -if [ -z "$MINI" ] ; then - run_stage_0 "$CLI" -fi - -echo "OK" diff --git a/qa/suites/basic/health-nfs-ganesha.sh b/qa/suites/basic/health-nfs-ganesha.sh index 8bfd0c2ef..9b6091bb3 100755 --- a/qa/suites/basic/health-nfs-ganesha.sh +++ b/qa/suites/basic/health-nfs-ganesha.sh @@ -36,17 +36,15 @@ function usage { echo echo "Usage:" echo " $SCRIPTNAME [-h,--help] [--cli] [--fsal={cephfs,rgw,both}]" - echo " [--mini]" echo echo "Options:" echo " --cli Use DeepSea CLI" echo " --fsal Defaults to cephfs" echo " --help Display this usage message" - echo " --mini Omit long-running tests" exit 1 } -TEMP=$(getopt -o h --long "cli,fsal:,help,mini,smoke" \ +TEMP=$(getopt -o h --long "cli,fsal:,help" \ -n 'health-nfs-ganesha.sh' -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -57,13 +55,11 @@ eval set -- "$TEMP" # process options CLI="" FSAL="cephfs" -MINI="" while true ; do case "$1" in --cli) CLI="cli" ; shift ;; --fsal) FSAL=$2 ; shift ; shift ;; -h|--help) usage ;; # does not return - --mini|--smoke) MINI="$1" ; shift ;; --) shift ; break ;; *) echo "Internal error" ; exit 1 ;; esac @@ -111,9 +107,7 @@ for v in "" "3" "4" ; do nfs_ganesha_umount sleep 10 done - -if [ -z "$MINI" ] ; then - run_stage_0 "$CLI" -fi +# exercise ceph.restart orchestration +run_stage_0 "$CLI" echo "OK" diff --git a/qa/suites/basic/health-ok.sh b/qa/suites/basic/health-ok.sh index f6a4384e4..ea026483d 100755 --- a/qa/suites/basic/health-ok.sh +++ b/qa/suites/basic/health-ok.sh @@ -2,16 +2,15 @@ # # DeepSea integration test "suites/basic/health-ok.sh" # -# This script runs DeepSea stages 0-3 to deploy a Ceph cluster, optionally -# with data-at-rest encryption of OSDs, on all the nodes that have at least -# one external disk drive. After stage 3 completes, the script checks for -# HEALTH_OK and tests the "ceph.restart" orchestration if --mini is not provided. +# This script runs DeepSea stages 0-3 (or 0-4, depending on options) to deploy +# a Ceph cluster, optionally with RGW, MDS, and/or data-at-rest encryption of +# OSDs, on all the nodes that have at least one external disk drive. After the +# last stage completes, the script checks for HEALTH_OK. # # The script makes no assumptions beyond those listed in qa/README. # -# On success (HEALTH_OK is reached and optionally "ceph.restart" orchestration behaves -# as expected), the script returns 0. On failure, for whatever reason, the -# script returns non-zero. +# On success (HEALTH_OK is reached), the script returns 0. On failure, for +# whatever reason, the script returns non-zero. # # The script produces verbose output on stdout, which can be captured for later # forensic analysis. @@ -32,20 +31,25 @@ function usage { echo "for use in SUSE Enterprise Storage testing" echo echo "Usage:" - echo " $SCRIPTNAME [-h,--help] [--cli] [--mini]" + echo " $SCRIPTNAME [-h,--help] [--cli] [--client-nodes=X]" + echo " [--mds] [--min-nodes=X] [--rgw] [--ssl]" echo echo "Options:" - echo " --cli Use DeepSea CLI" - echo " --encryption Deploy OSDs with data-at-rest encryption" - echo " --mini Omit long-running tests" - echo " --help Display this usage message" + echo " --cli Use DeepSea CLI" + echo " --client-nodes Number of client (non-cluster) nodes" + echo " --encryption Deploy OSDs with data-at-rest encryption" + echo " --mds Deploy MDS" + echo " --min-nodes Minimum number of nodes" + echo " --help Display this usage message" + echo " --rgw Deploy RGW" + echo " --ssl Deploy RGW with SSL" exit 1 } assert_enhanced_getopt TEMP=$(getopt -o h \ ---long "cli,encrypted,encryption,help,mini,smoke" \ +--long "cli,client-nodes:,encrypted,encryption,help,mds,min-nodes:,rgw,ssl" \ -n 'health-ok.sh' -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -55,24 +59,30 @@ eval set -- "$TEMP" # process command-line options CLI="" +CLIENT_NODES=0 STORAGE_PROFILE="default" -MINI="" +MDS="" +MIN_NODES=1 +RGW="" +SSL="" while true ; do case "$1" in --cli) CLI="$1" ; shift ;; + --client-nodes) shift ; CLIENT_NODES=$1 ; shift ;; --encrypted|--encryption) STORAGE_PROFILE="dmcrypt" ; shift ;; - --mini|--smoke) MINI="$1" ; shift ;; + --mds) MDS="$1" ; shift ;; + --min-nodes) shift ; MIN_NODES=$1 ; shift ;; -h|--help) usage ;; # does not return + --rgw) RGW="$1" ; shift ;; + --ssl) SSL="$1" ; shift ;; --) shift ; break ;; *) echo "Internal error" ; exit 1 ;; esac done echo "WWWW" -echo "Running health-ok.sh with options $CLI $ENCRYPTION $MINI" +echo "Running health-ok.sh with options $CLI $ENCRYPTION $MDS $RGW $SSL" # deploy phase -MIN_NODES=1 -CLIENT_NODES=0 deploy_ceph # test phase @@ -81,22 +91,13 @@ ceph_log_grep_enoent_eaccess test_systemd_ceph_osd_target_wants rados_write_test ceph_version_test -if [ -z "$MINI" ] ; then - run_stage_0 "$CLI" - restart_services - mon_restarted "1" # 1 means not restarted - osd_restarted "1" - # apply config change - change_osd_conf - change_mon_conf - # construct and spread config - run_stage_3 "$CLI" - restart_services - mon_restarted "0" # 0 means restarted - osd_restarted "0" - # make sure still in HEALTH_OK - ceph_cluster_status - ceph_health_test +if [ -n "$RGW" ] ; then + rgw_curl_test + test -n "$SSL" && validate_rgw_cert_perm + rgw_user_and_bucket_list + rgw_validate_system_user fi +test -n "$MDS" -a "$CLIENT_NODES" -ge 1 && cephfs_mount_and_sanity_test +echo "YYYY" echo "health-ok test result: PASS" diff --git a/qa/suites/basic/health-rgw.sh b/qa/suites/basic/health-rgw.sh deleted file mode 100755 index 1f3fc7272..000000000 --- a/qa/suites/basic/health-rgw.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# DeepSea integration test "suites/basic/health-rgw.sh" -# -# This script runs DeepSea stages 0-4 to deploy a Ceph cluster with RGW (and -# optionally RGW+SSL). After stage 4 completes, it sends a GET request to the -# RGW node using curl (optionally using SSL endpoint), and tests that: (a) the -# response contains the string "anonymous" and (b) the response is legal XML. -# The script also deploys some RGW demo users. -# -# The script makes no assumptions beyond those listed in qa/README. -# -# On success, the script returns 0. On failure, for whatever reason, the script -# returns non-zero. -# -# The script produces verbose output on stdout, which can be captured for later -# forensic analysis. -# - -set -ex - -SCRIPTNAME=$(basename ${0}) -BASEDIR=$(readlink -f "$(dirname ${0})/../..") -test -d $BASEDIR -[[ $BASEDIR =~ \/qa$ ]] - -source $BASEDIR/common/common.sh - -function usage { - set +x - echo "$SCRIPTNAME - script for testing RADOS Gateway deployment" - echo "for use in SUSE Enterprise Storage testing" - echo - echo "Usage:" - echo " $SCRIPTNAME [-h,--help] [--cli] [--mini] [--ssl]" - echo - echo "Options:" - echo " --cli Use DeepSea CLI" - echo " --help Display this usage message" - echo " --mini Omit long-running tests" - echo " --ssl Use SSL (https, port 443) with RGW" - exit 1 -} - -TEMP=$(getopt -o h --long "cli,help,mini,smoke,ssl" \ - -n 'health-rgw.sh' -- "$@") - -if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi - -# Note the quotes around TEMP': they are essential! -eval set -- "$TEMP" - -# process command-line options -CLI="" -MINI="" -SSL="" -while true ; do - case "$1" in - --cli) CLI="$1" ; shift ;; - -h|--help) usage ;; # does not return - --mini|--smoke) MINI="$1" ; shift ;; - --ssl) SSL="$1" ; shift ;; - --) shift ; break ;; - *) echo "Internal error" ; exit 1 ;; - esac -done - -# deploy phase -MIN_NODES=1 -CLIENT_NODES=0 -STORAGE_PROFILE="default" -RGW="--rgw" -deploy_ceph - -# test phase -ceph_health_test -rgw_curl_test -test -n "$SSL" && validate_rgw_cert_perm -rgw_user_and_bucket_list -rgw_validate_system_user -ceph_health_test -if [ -z "$MINI" ] ; then - run_stage_0 "$CLI" - restart_services - rgw_restarted "1" # 1 means not restarted - # apply config change - change_rgw_conf - # construct and spread config - run_stage_3 "$CLI" - restart_services - rgw_restarted "0" # 0 means restarted -fi - -echo "health-rgw test result: PASS" diff --git a/srv/salt/ceph/smoketests/apparmor/init.sls b/srv/salt/ceph/functests/1node/apparmor/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/apparmor/init.sls rename to srv/salt/ceph/functests/1node/apparmor/init.sls diff --git a/srv/salt/ceph/smoketests/init.sls b/srv/salt/ceph/functests/1node/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/init.sls rename to srv/salt/ceph/functests/1node/init.sls diff --git a/srv/salt/ceph/smoketests/keyrings/init.sls b/srv/salt/ceph/functests/1node/keyrings/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/keyrings/init.sls rename to srv/salt/ceph/functests/1node/keyrings/init.sls diff --git a/srv/salt/ceph/smoketests/macros/os_switch/init.sls b/srv/salt/ceph/functests/1node/macros/os_switch/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/macros/os_switch/init.sls rename to srv/salt/ceph/functests/1node/macros/os_switch/init.sls diff --git a/srv/salt/ceph/smoketests/openstack/default.sls b/srv/salt/ceph/functests/1node/openstack/default.sls similarity index 100% rename from srv/salt/ceph/smoketests/openstack/default.sls rename to srv/salt/ceph/functests/1node/openstack/default.sls diff --git a/srv/salt/ceph/smoketests/openstack/init.sls b/srv/salt/ceph/functests/1node/openstack/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/openstack/init.sls rename to srv/salt/ceph/functests/1node/openstack/init.sls diff --git a/srv/salt/ceph/smoketests/openstack/prefix.sls b/srv/salt/ceph/functests/1node/openstack/prefix.sls similarity index 100% rename from srv/salt/ceph/smoketests/openstack/prefix.sls rename to srv/salt/ceph/functests/1node/openstack/prefix.sls diff --git a/srv/salt/ceph/smoketests/quiescent/init.sls b/srv/salt/ceph/functests/1node/quiescent/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/quiescent/init.sls rename to srv/salt/ceph/functests/1node/quiescent/init.sls diff --git a/srv/salt/ceph/smoketests/restart/common.sls b/srv/salt/ceph/functests/1node/restart/common.sls similarity index 100% rename from srv/salt/ceph/smoketests/restart/common.sls rename to srv/salt/ceph/functests/1node/restart/common.sls diff --git a/srv/salt/ceph/smoketests/restart/mds.sls b/srv/salt/ceph/functests/1node/restart/mds.sls similarity index 100% rename from srv/salt/ceph/smoketests/restart/mds.sls rename to srv/salt/ceph/functests/1node/restart/mds.sls diff --git a/srv/salt/ceph/smoketests/restart/mgr.sls b/srv/salt/ceph/functests/1node/restart/mgr.sls similarity index 100% rename from srv/salt/ceph/smoketests/restart/mgr.sls rename to srv/salt/ceph/functests/1node/restart/mgr.sls diff --git a/srv/salt/ceph/smoketests/restart/mon.sls b/srv/salt/ceph/functests/1node/restart/mon.sls similarity index 100% rename from srv/salt/ceph/smoketests/restart/mon.sls rename to srv/salt/ceph/functests/1node/restart/mon.sls diff --git a/srv/salt/ceph/smoketests/restart/rgw.sls b/srv/salt/ceph/functests/1node/restart/rgw.sls similarity index 100% rename from srv/salt/ceph/smoketests/restart/rgw.sls rename to srv/salt/ceph/functests/1node/restart/rgw.sls diff --git a/srv/salt/ceph/smoketests/tuned/init.sls b/srv/salt/ceph/functests/1node/tuned/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/tuned/init.sls rename to srv/salt/ceph/functests/1node/tuned/init.sls diff --git a/srv/salt/ceph/smoketests/tuned/off/init.sls b/srv/salt/ceph/functests/1node/tuned/off/init.sls similarity index 100% rename from srv/salt/ceph/smoketests/tuned/off/init.sls rename to srv/salt/ceph/functests/1node/tuned/off/init.sls