mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-31 01:56:39 +00:00
add xcat-inventory passwd network route validation testcase
This commit is contained in:
parent
5ce290ba4b
commit
db6c5b7720
37
xCAT-test/autotest/testcase/xcat-inventory/cases.network
Normal file
37
xCAT-test/autotest/testcase/xcat-inventory/cases.network
Normal file
@ -0,0 +1,37 @@
|
||||
start:xcat_inventory_import_validation_network
|
||||
description:This case is used to test network validation function of xcat-inventory import yaml and json file. To test "net" "mask" "dynamicrange" and "staticrange" attributes
|
||||
cmd:lsdef -t network -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t network -o autotestnet -z >/tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza ;rmdef -t network -o autotestnet;fi
|
||||
check:rc==0
|
||||
cmd:mkdir -p /tmp/xcat_inventory_import_validation_network_bak
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234abc" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "net" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.abc.456.789" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "mask" "234.0.0.0" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "dynamicrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100-200.0.0.200" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "200.0.0.100" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "network" "autotestnet" "staticrange" "abc-bcd" "/tmp/xcat_inventory_import_validation_network"
|
||||
check:rc!=0
|
||||
cmd:if [[ -e /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_network_bak/autotestnet.stanza | mkdef -z; fi
|
||||
check:rc==0
|
||||
cmd:rm -rf /tmp/xcat_inventory_import_validation_network_bak
|
||||
check:rc==0
|
||||
end
|
23
xCAT-test/autotest/testcase/xcat-inventory/cases.passwd
Normal file
23
xCAT-test/autotest/testcase/xcat-inventory/cases.passwd
Normal file
@ -0,0 +1,23 @@
|
||||
start:xcat_inventory_import_validation_passwd
|
||||
description:This case is used to test passwd validation function of xcat-inventory import yaml and json file. To test "cryptmethod" attribute
|
||||
cmd:tabdump -w 'key==autotest' passwd |grep autotest > /dev/null 2>&1;if [[ $? -eq 0 ]]; then xcat-inventory export -t passwd -o autotest >/tmp/xcat_inventory_import_validation_passwd_bak/autotest ;tabch -d 'key==autotest' passwd;fi
|
||||
check:rc==0
|
||||
cmd:mkdir -p /tmp/xcat_inventory_import_validation_passwd_bak
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "md5" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha256" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "sha512" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "a.a" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "passwd" "autotest" "cryptmethod" "MD5" "/tmp/xcat_inventory_import_validation_passwd"
|
||||
check:rc!=0
|
||||
cmd:if [[ -e /tmp/xcat_inventory_import_validation_passwd_bak/autotest ]]; then xcat-inventory import -f /tmp/xcat_inventory_import_validation_passwd_bak/autotest; fi
|
||||
check:rc==0
|
||||
cmd:rm -rf /tmp/xcat_inventory_import_validation_passwd_bak
|
||||
check:rc==0
|
||||
end
|
21
xCAT-test/autotest/testcase/xcat-inventory/cases.route
Normal file
21
xCAT-test/autotest/testcase/xcat-inventory/cases.route
Normal file
@ -0,0 +1,21 @@
|
||||
start:xcat_inventory_import_validation_route
|
||||
description:This case is used to test route validation function of xcat-inventory import yaml and json file. To test "net" and "mask" attributes
|
||||
cmd:mkdir -p /tmp/xcat_inventory_import_validation_route_bak
|
||||
check:rc==0
|
||||
cmd:lsdef -t route -o autotestnet > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t route -o autotestnet -z >/tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ;rmdef -t route -o autotestnet;fi
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0.0.0" "/tmp/xcat_inventory_import_validation_route"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "200.0" "/tmp/xcat_inventory_import_validation_route"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "" "/tmp/xcat_inventory_import_validation_route"
|
||||
check:rc!=0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "default" "/tmp/xcat_inventory_import_validation_route"
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/validatehelper "route" "autotestnet" "net" "abc.345.123.202" "/tmp/xcat_inventory_import_validation_route"
|
||||
check:rc!=0
|
||||
cmd:if [[ -e /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza ]]; then cat /tmp/xcat_inventory_import_validation_route_bak/autotestnet.stanza | mkdef -z;fi
|
||||
check:rc==0
|
||||
cmd:rm -rf /tmp/xcat_inventory_import_validation_route_bak
|
||||
check:rc==0
|
||||
end
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"network": {
|
||||
"autotestnet": {
|
||||
"basic_attr": {
|
||||
"gateway": "123.0.0.100",
|
||||
"mask": "255.0.0.0",
|
||||
"net": "123.0.0.0"
|
||||
},
|
||||
"pool": {
|
||||
"dynamicrange": "123.0.0.100-123.0.0.200",
|
||||
"staticrange": "123.0.0.201-123.0.0.222"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema_version": "1.0"
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
network:
|
||||
autotestnet:
|
||||
basic_attr:
|
||||
gateway: 123.0.0.100
|
||||
mask: 255.0.0.0
|
||||
net: 123.0.0.0
|
||||
pool:
|
||||
dynamicrange: 123.0.0.100-123.0.0.200
|
||||
staticrange: 123.0.0.201-123.0.0.222
|
||||
schema_version: '1.0'
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"passwd": {
|
||||
"autotest": {
|
||||
"cryptmethod": "md5",
|
||||
"password": "cluster",
|
||||
"username": "root"
|
||||
}
|
||||
},
|
||||
"schema_version": "1.0"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
passwd:
|
||||
autotest:
|
||||
cryptmethod: md5
|
||||
password: cluster
|
||||
username: root
|
||||
schema_version: '1.0'
|
||||
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"route": {
|
||||
"autotestnet": {
|
||||
"gateway": "0.0.0.0",
|
||||
"ifname": "eth1",
|
||||
"mask": "255.0.0.0",
|
||||
"net": "100.0.0.0",
|
||||
"usercomment": "hello world"
|
||||
}
|
||||
},
|
||||
"schema_version": "1.0"
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
route:
|
||||
autotestnet:
|
||||
gateway: 0.0.0.0
|
||||
ifname: eth1
|
||||
mask: 255.0.0.0
|
||||
net: 100.0.0.0
|
||||
usercomment: hello world
|
||||
schema_version: '1.0'
|
||||
|
Loading…
x
Reference in New Issue
Block a user