2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-28 06:23:26 +00:00
robin2008 3745bac26d Update the testcase to cover the changes in #5119
using regular expression to cover the error/warn message which contains the server name
2018-05-26 11:44:44 +08:00

59 lines
2.3 KiB
Plaintext

start:get_networks_table_rest
description: get all networks table entries with REST API
cmd:restapitest -m GET -r /tables/networks/rows -u $$username -p $$password
check:rc==200
check:output=~netname
end
start:get_network_table_rest
description: get all entries from invalid table name with REST API
cmd:restapitest -m GET -r /tables/network/rows -u $$username -p $$password
check:rc==147
check:output=~No such table
end
start:get_network_table_with_attr_selection_rest
description: get all attribute matching networks table entries with REST API
cmd:restapitest -m GET -r /tables/networks/rows/mask=255.0.0.0 -u $$username -p $$password
check:rc==200
check:output=~"mask":"255.0.0.0"
end
start:get_network_table_with_attr_selection_error_rest
description: get all attribute matching networks table entries with REST API, invalid attribute name
cmd:restapitest -m GET -r /tables/networks/rows/abc=255.0.0.0 -u $$username -p $$password
check:rc==147
check:output=~No table rows
end
start:get_network_table_with_attr_selection_error_rest2
description: get all attribute matching networks table entries with REST API, no match
cmd:restapitest -m GET -r /tables/networks/rows/mask=a.b.c.d -u $$username -p $$password
check:rc==147
check:output=~No table rows
end
start:get_network_table_with_attr_selection_rest2
description: get attribute matching networks table attributes with REST API
cmd:restapitest -m GET -r /tables/networks/rows/mask=255.0.0.0/gateway -u $$username -p $$password
check:rc==200
check:output=~"gateway":"
end
start:set_network_table_attr_with_attr_selection_rest2
description: set attribute for network table for attr seleection with REST API
cmd:restapitest -m PUT -r /tables/networks/rows/mask=255.0.0.0 -d '{"comments":"REST API TEST"}' -u $$username -p $$password
check:rc==200
cmd:lsdef -l -t network
check:output=~REST API TEST
end
start:delete_network_rest
description: create a network and delele network with REST API
cmd: restapitest -m POST -r /networks/network_rest -d '{"gateway":"10.1.0.1","mask":"255.255.0.0","net":"199.168.0.0"}' -u $$username -p $$password
cmd: restapitest -m DELETE -r /tables/networks/rows/net=199.168.0.0 -u $$username -p $$password
check:rc==200
cmd: lsdef -t network network_rest
check:output=~Error: (\[.*?\]: )?Could not find an object named 'network_rest' of type 'network'.
end