зеркало из https://github.com/microsoft/cobalt.git
change to sample test files.
This commit is contained in:
Родитель
7ebf25d07a
Коммит
0e8fd3d779
|
@ -17,7 +17,7 @@ function printResult {
|
|||
if [ $items == 0 ]
|
||||
then
|
||||
printf "\e[0;31mFailed...\n"
|
||||
if [ $exit_on_error -eq 1 ]; then exit 1; else return 1; fi
|
||||
if [ $exit_on_error -eq 1 ]; then exit 1; fi
|
||||
else
|
||||
printf "\e[0;32mSuccess...\n"
|
||||
fi
|
||||
|
@ -27,7 +27,7 @@ function printResult {
|
|||
printf "\e[0;32mSuccess...\n"
|
||||
else
|
||||
printf "\e[0;31mFailed...\n"
|
||||
if [ $exit_on_error -eq 1 ]; then exit 1; else return 1; fi
|
||||
if [ $exit_on_error -eq 1 ]; then exit 1; fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -55,5 +55,19 @@ function assertResource {
|
|||
query="az resource list -g $rg --resource-type $resource_type --query '[?name==\`${resource_name}\`] | length(@)'"
|
||||
items=`eval $query`
|
||||
|
||||
printResult $items $state
|
||||
}
|
||||
|
||||
# Search subnet inside an Azure VNET"
|
||||
function assertSubnet {
|
||||
rg=$1
|
||||
vnet_name=$2
|
||||
resource_name=$3
|
||||
state=${4:-"do"}
|
||||
|
||||
printf "\e[1;37mTesting Resource Group: $rg, VNET: $vnet_name, Name: $resource_name -"\ $state\ "exist\n"
|
||||
query="az network vnet subnet list -g $rg --vnet-name $vnet_name --query '[?name==\`${resource_name}\`] | length(@)'"
|
||||
items=`eval $query`
|
||||
|
||||
printResult $items $state
|
||||
}
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
. ./assert.sh continue_on_error # load test functions with continue_on_error/stop_on_error
|
||||
|
||||
. ./test.sh # sample1
|
||||
. ./test2.sh # sample2
|
||||
. ./sampleTest1.sh # sample1
|
||||
. ./sampleTest2.sh # sample2
|
|
@ -0,0 +1,3 @@
|
|||
assertRG expected-resource-group-name
|
||||
assertSubnet expected-resource-group-name expected-vnet-name expected-subnet-name
|
||||
|
|
@ -1 +0,0 @@
|
|||
assertRG expected-resource-group-name
|
Загрузка…
Ссылка в новой задаче