2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-24 04:00:26 +00:00

Merge pull request #5234 from immarvin/ontest

update xcat-inventory test cases according to the modification in xcat-inventory 0.1.2
This commit is contained in:
Weihua Hu
2018-05-22 17:02:19 +08:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ end
start:xcat_inventory_invalid_subcmd
description:This case is used to test xcat-inventory export subcommand to handle invalid subcommand. The vaild subcommand are export and import.
cmd:xcat-inventory aaa
check:output=~ xcat-inventory: error: argument <subcommand>: invalid choice:
check:output=~ Error: not a valid subcommand to run
check:output=~ usage:
check:rc!=0
end
@@ -67,7 +67,7 @@ cmd:mkdir -p /tmp/xcat_inventory_import_option_f_invalid_file
check:rc==0
#to handle a non-existed file
cmd:xcat-inventory import -f aaa
check:output=~The specified path does not exist
check:output=~The specified inventory file does not exist
check:output !~Traceback
check:rc!=0
#To handle a invalid json file

View File

@@ -730,10 +730,10 @@ check:rc==0
cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza ;rmdef bogusnode;fi
check:rc==0
cmd: xcat-inventory export --format=json -t node -o bogusnode
check:output=~Error: cannot find objects: bogusnode!
check:output=~Error: cannot find node objects: bogusnode!
check:rc!=0
cmd: xcat-inventory export --format=yaml -t node -o bogusnode
check:output=~Error: cannot find objects: bogusnode!
check:output=~Error: cannot find node objects: bogusnode!
check:rc!=0
cmd:if [[ -e /tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza ]]; then cat /tmp/xcat_inventory_try_to_export_nonexisted_node/bogusnode.stanza | mkdef -z;fi
check:rc==0
@@ -752,12 +752,12 @@ check:rc==0
cmd:xcat-inventory export --format=json -t node -o bogusnode |tee /tmp/xcat_inventory_try_to_import_nonexisted_node/json
check:rc==0
cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_nonexisted_node/json -t node -o bogusnode1
check:output=~Error: cannot find objects: bogusnode1!
check:output=~Error: cannot find node objects: bogusnode1!
check:rc!=0
cmd:xcat-inventory export --format=yaml -t node -o bogusnode |tee /tmp/xcat_inventory_try_to_import_nonexisted_node/yaml
check:rc==0
cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_nonexisted_node/yaml -t node -o bogusnode1
check:output=~Error: cannot find objects: bogusnode1!
check:output=~Error: cannot find node objects: bogusnode1!
check:rc!=0
cmd:rmdef bogusnode
check:rc==0

View File

@@ -14,7 +14,7 @@ check: rc==0
cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "invalid" "/tmp/xcat_inventory_import_validation_osimage/trash/"
check: rc!=0
cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "role" "" "/tmp/xcat_inventory_import_validation_osimage/trash/"
check: rc!=0
check: rc==0
cmd: /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "osimage" "testosimage1" "imagetype" "windows" "/tmp/xcat_inventory_import_validation_osimage/trash/"
check: rc==0