@@ -14,114 +14,115 @@ else
1414 NOAUTH=
1515fi
1616
17+ FORMAT=" --request-format xml"
1718
1819# test the CRUD of network
1920network=mynet1
20- quantum net-create $NOAUTH $network || die " fail to create network $network "
21- temp=` quantum net-list -- --name $network --fields id | wc -l`
21+ quantum net-create $FORMAT $ NOAUTH $network || die " fail to create network $network "
22+ temp=` quantum net-list $FORMAT -- --name $network --fields id | wc -l`
2223echo $temp
2324if [ $temp -ne 5 ]; then
2425 die " networks with name $network is not unique or found"
2526fi
2627network_id=` quantum net-list -- --name $network --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
2728echo " ID of network with name $network is $network_id "
2829
29- quantum net-show $network || die " fail to show network $network "
30- quantum net-show $network_id || die " fail to show network $network_id "
30+ quantum net-show $FORMAT $ network || die " fail to show network $network "
31+ quantum net-show $FORMAT $ network_id || die " fail to show network $network_id "
3132
32- quantum net-update $network --admin_state_up False || die " fail to update network $network "
33- quantum net-update $network_id --admin_state_up True || die " fail to update network $network_id "
33+ quantum net-update $FORMAT $ network --admin_state_up False || die " fail to update network $network "
34+ quantum net-update $FORMAT $ network_id --admin_state_up True || die " fail to update network $network_id "
3435
35- quantum net-list -c id -- --id fakeid || die " fail to list networks with column selection on empty list"
36+ quantum net-list $FORMAT -c id -- --id fakeid || die " fail to list networks with column selection on empty list"
3637
3738# test the CRUD of subnet
3839subnet=mysubnet1
3940cidr=10.0.1.3/24
40- quantum subnet-create $NOAUTH $network $cidr --name $subnet || die " fail to create subnet $subnet "
41- tempsubnet=` quantum subnet-list -- --name $subnet --fields id | wc -l`
41+ quantum subnet-create $FORMAT $ NOAUTH $network $cidr --name $subnet || die " fail to create subnet $subnet "
42+ tempsubnet=` quantum subnet-list $FORMAT -- --name $subnet --fields id | wc -l`
4243echo $tempsubnet
4344if [ $tempsubnet -ne 5 ]; then
4445 die " subnets with name $subnet is not unique or found"
4546fi
46- subnet_id=` quantum subnet-list -- --name $subnet --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
47+ subnet_id=` quantum subnet-list $FORMAT -- --name $subnet --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
4748echo " ID of subnet with name $subnet is $subnet_id "
48- quantum subnet-show $subnet || die " fail to show subnet $subnet "
49- quantum subnet-show $subnet_id || die " fail to show subnet $subnet_id "
49+ quantum subnet-show $FORMAT $ subnet || die " fail to show subnet $subnet "
50+ quantum subnet-show $FORMAT $ subnet_id || die " fail to show subnet $subnet_id "
5051
51- quantum subnet-update $subnet --dns_namesevers host1 || die " fail to update subnet $subnet "
52- quantum subnet-update $subnet_id --dns_namesevers host2 || die " fail to update subnet $subnet_id "
52+ quantum subnet-update $FORMAT $ subnet --dns_namesevers host1 || die " fail to update subnet $subnet "
53+ quantum subnet-update $FORMAT $ subnet_id --dns_namesevers host2 || die " fail to update subnet $subnet_id "
5354
5455# test the crud of ports
5556port=myport1
56- quantum port-create $NOAUTH $network --name $port || die " fail to create port $port "
57- tempport=` quantum port-list -- --name $port --fields id | wc -l`
57+ quantum port-create $FORMAT $ NOAUTH $network --name $port || die " fail to create port $port "
58+ tempport=` quantum port-list $FORMAT -- --name $port --fields id | wc -l`
5859echo $tempport
5960if [ $tempport -ne 5 ]; then
6061 die " ports with name $port is not unique or found"
6162fi
62- port_id=` quantum port-list -- --name $port --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
63+ port_id=` quantum port-list $FORMAT -- --name $port --fields id | tail -n 2 | head -n 1 | cut -d' ' -f 2`
6364echo " ID of port with name $port is $port_id "
64- quantum port-show $port || die " fail to show port $port "
65- quantum port-show $port_id || die " fail to show port $port_id "
65+ quantum port-show $FORMAT $ port || die " fail to show port $port "
66+ quantum port-show $FORMAT $ port_id || die " fail to show port $port_id "
6667
67- quantum port-update $port --device_id deviceid1 || die " fail to update port $port "
68- quantum port-update $port_id --device_id deviceid2 || die " fail to update port $port_id "
68+ quantum port-update $FORMAT $ port --device_id deviceid1 || die " fail to update port $port "
69+ quantum port-update $FORMAT $ port_id --device_id deviceid2 || die " fail to update port $port_id "
6970
7071# test quota commands RUD
7172DEFAULT_NETWORKS=10
7273DEFAULT_PORTS=50
7374tenant_id=tenant_a
7475tenant_id_b=tenant_b
75- quantum quota-update --tenant_id $tenant_id --network 30 || die " fail to update quota for tenant $tenant_id "
76- quantum quota-update --tenant_id $tenant_id_b --network 20 || die " fail to update quota for tenant $tenant_id "
77- networks=` quantum quota-list -c network -c tenant_id | grep $tenant_id | awk ' {print $2}' `
76+ quantum quota-update $FORMAT --tenant_id $tenant_id --network 30 || die " fail to update quota for tenant $tenant_id "
77+ quantum quota-update $FORMAT --tenant_id $tenant_id_b --network 20 || die " fail to update quota for tenant $tenant_id "
78+ networks=` quantum quota-list $FORMAT -c network -c tenant_id | grep $tenant_id | awk ' {print $2}' `
7879if [ $networks -ne 30 ]; then
7980 die " networks quota should be 30"
8081fi
81- networks=` quantum quota-list -c network -c tenant_id | grep $tenant_id_b | awk ' {print $2}' `
82+ networks=` quantum quota-list $FORMAT -c network -c tenant_id | grep $tenant_id_b | awk ' {print $2}' `
8283if [ $networks -ne 20 ]; then
8384 die " networks quota should be 20"
8485fi
85- networks=` quantum quota-show --tenant_id $tenant_id | grep network | awk -F' |' ' {print $3}' `
86+ networks=` quantum quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F' |' ' {print $3}' `
8687if [ $networks -ne 30 ]; then
8788 die " networks quota should be 30"
8889fi
89- quantum quota-delete --tenant_id $tenant_id || die " fail to delete quota for tenant $tenant_id "
90- networks=` quantum quota-show --tenant_id $tenant_id | grep network | awk -F' |' ' {print $3}' `
90+ quantum quota-delete $FORMAT --tenant_id $tenant_id || die " fail to delete quota for tenant $tenant_id "
91+ networks=` quantum quota-show $FORMAT --tenant_id $tenant_id | grep network | awk -F' |' ' {print $3}' `
9192if [ $networks -ne $DEFAULT_NETWORKS ]; then
9293 die " networks quota should be $DEFAULT_NETWORKS "
9394fi
9495# update self
9596if [ " t$NOAUTH " = " t" ]; then
9697 # with auth
97- quantum quota-update --port 99 || die " fail to update quota for self"
98- ports=` quantum quota-show | grep port | awk -F' |' ' {print $3}' `
98+ quantum quota-update $FORMAT --port 99 || die " fail to update quota for self"
99+ ports=` quantum quota-show $FORMAT | grep port | awk -F' |' ' {print $3}' `
99100 if [ $ports -ne 99 ]; then
100101 die " ports quota should be 99"
101102 fi
102103
103- ports=` quantum quota-list -c port | grep 99 | awk ' {print $2}' `
104+ ports=` quantum quota-list $FORMAT -c port | grep 99 | awk ' {print $2}' `
104105 if [ $ports -ne 99 ]; then
105106 die " ports quota should be 99"
106107 fi
107- quantum quota-delete || die " fail to delete quota for tenant self"
108- ports=` quantum quota-show | grep port | awk -F' |' ' {print $3}' `
108+ quantum quota-delete $FORMAT || die " fail to delete quota for tenant self"
109+ ports=` quantum quota-show $FORMAT | grep port | awk -F' |' ' {print $3}' `
109110 if [ $ports -ne $DEFAULT_PORTS ]; then
110111 die " ports quota should be $DEFAULT_PORTS "
111112 fi
112113else
113114 # without auth
114- quantum quota-update --port 100
115+ quantum quota-update $FORMAT --port 100
115116 if [ $? -eq 0 ]; then
116117 die " without valid context on server, quota update command should fail."
117118 fi
118- quantum quota-show
119+ quantum quota-show $FORMAT
119120 if [ $? -eq 0 ]; then
120121 die " without valid context on server, quota show command should fail."
121122 fi
122- quantum quota-delete
123+ quantum quota-delete $FORMAT
123124 if [ $? -eq 0 ]; then
124125 die " without valid context on server, quota delete command should fail."
125126 fi
126- quantum quota-list || die " fail to update quota for self"
127+ quantum quota-list $FORMAT || die " fail to update quota for self"
127128fi
0 commit comments