2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 12:20:40 +00:00

refine xcat-inventory test case

This commit is contained in:
yangsbj
2018-05-24 23:35:53 -04:00
parent a758733d83
commit 521f265eb1
2 changed files with 19 additions and 12 deletions

View File

@ -66,13 +66,15 @@ check:rc==0
cmd:xcat-inventory export --format=yaml -t node -o bogusnode -f /tmp/xcat_inventory_export_option_f/export_yaml_with_f
check:rc==0
check:output !~Traceback
cmd:diff /tmp/xcat_inventory_export_option_f/export_yaml_without_f /tmp/xcat_inventory_export_option_f/export_yaml_with_f
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_export_option_f/export_yaml_without_f /tmp/xcat_inventory_export_option_f/export_yaml_with_f
check:rc==0
cmd:xcat-inventory export -t node -o bogusnode | tee /tmp/xcat_inventory_export_option_f/export_json_without_f
check:rc==0
cmd:xcat-inventory export -t node -o bogusnode --path /tmp/xcat_inventory_export_option_f/export_json_with_f
check:rc==0
cmd:diff /tmp/xcat_inventory_export_option_f/export_json_without_f /tmp/xcat_inventory_export_option_f/export_json_with_f
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_export_option_f/export_json_without_f /tmp/xcat_inventory_export_option_f/export_json_with_f
check:rc==0
cmd:xcat-inventory export -t node -o bogusnode -f
check:rc!=0
@ -101,7 +103,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 inventory file does not exist
check:output=~the directory does not exist or is not a directory
check:output !~Traceback
check:rc!=0
#To handle a invalid json file

View File

@ -31,7 +31,7 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd: cat /tmp/export_import_site_by_yaml/dstsite.stanza
check:rc==0
cmd:diff -y /tmp/export_import_site_by_yaml/srcsite.stanza /tmp/export_import_site_by_yaml/dstsite.stanza
cmd:diff -y --ignore-blank-lines /tmp/export_import_site_by_yaml/srcsite.stanza /tmp/export_import_site_by_yaml/dstsite.stanza
check:rc==0
cmd:cat /tmp/export_import_site_by_yaml/site.stanza | mkdef -z -f
check:rc==0
@ -77,7 +77,7 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd: cat /tmp/export_import_site_by_json/dstsite.stanza
check:rc==0
cmd:diff -y /tmp/export_import_site_by_json/srcsite.stanza /tmp/export_import_site_by_json/dstsite.stanza
cmd:diff -y --ignore-blank-lines /tmp/export_import_site_by_json/srcsite.stanza /tmp/export_import_site_by_json/dstsite.stanza
check:rc==0
cmd:cat /tmp/export_import_site_by_json/site.stanza | mkdef -z -f
check:rc==0
@ -197,7 +197,8 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd:xcat-inventory export -t site |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export
check:rc==0
cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export
check:rc==0
cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.stanza | mkdef -z -f
check:rc==0
@ -312,7 +313,8 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd:xcat-inventory export --format=json -t site |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.export
check:rc==0
cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.export
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.export
check:rc==0
cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_json_format/site.stanza | mkdef -z -f
check:rc==0
@ -423,7 +425,8 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd:xcat-inventory export --format=yaml -t site|sed -e '/^\s*$/d' |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.export
check:rc==0
cmd:diff -y /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.export
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.export
check:rc==0
cmd:cat /tmp/xcat_inventory_try_to_export_all_type_is_site_yaml_format/site.stanza | mkdef -z -f
check:rc==0
@ -838,7 +841,8 @@ cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_site_
check:rc==0
cmd:lsdef -t site -o clustersite > /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.import
check:rc==0
cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.import
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_json_format/site.import
check:rc==0
cmd:lsdef bogusgroup1
check:output=~Error: Could not find an object
@ -1203,7 +1207,8 @@ cmd:xcat-inventory import -f /tmp/xcat_inventory_try_to_import_all_type_is_site_
check:rc==0
cmd:lsdef -t site -o clustersite > /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.import
check:rc==0
cmd:diff -y /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.import
cmd:#!/bin/bash
diff -y --ignore-blank-lines --ignore-matching-lines="^#" /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.org /tmp/xcat_inventory_try_to_import_all_type_is_site_yaml_format/site.import
check:rc==0
cmd:lsdef bogusgroup1
check:output=~Error: Could not find an object
@ -1278,7 +1283,7 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd: cat /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza
check:rc==0
cmd:diff -y /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza
cmd:diff -y --ignore-blank-lines /tmp/export_site_table_then_modify_yaml_then_import/srcsite.stanza /tmp/export_site_table_then_modify_yaml_then_import/dstsite.stanza
check:rc==0
cmd:cat /tmp/export_site_table_then_modify_yaml_then_import/site.stanza | mkdef -z -f
check:rc==0
@ -1341,7 +1346,7 @@ cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed
check:rc==0
cmd: cat /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza
check:rc==0
cmd:diff -y /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza
cmd:diff -y --ignore-blank-lines /tmp/export_site_table_then_modify_json_then_import/srcsite.stanza /tmp/export_site_table_then_modify_json_then_import/dstsite.stanza
check:rc==0
cmd:cat /tmp/export_site_table_then_modify_json_then_import/site.stanza | mkdef -z -f
check:rc==0