Skip to content

Commit

Permalink
add bats testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Aug 16, 2018
1 parent 4ab1ce5 commit 467470b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/01-multiple-interface/pod.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{},
"namespace":"default",
"containers":[
{
Expand Down
3 changes: 3 additions & 0 deletions tests/02-hoet-network/pod.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{
"myip":"1.2.3.4"
},
"namespace":"default",
"containers":[
{
Expand Down
5 changes: 5 additions & 0 deletions tests/02-hoet-network/script.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ load init
[ $status = 0 ]
[ "$output" = "true" ]
}

@test "Check Pod Env" {
kubectl get pods ${podName} -o jsonpath='{.spec.containers[0].env}' | grep "myip"
[ $? = 0 ]
}
@test "Delete Pod" {
run bash -c 'http http://127.0.0.1:7890/v1/pods/ 2>/dev/null | jq -r ".[0].id"'
run http DELETE http://127.0.0.1:7890/v1/pods/${output} 2>/dev/null
Expand Down
1 change: 1 addition & 0 deletions tests/03-storage-pod/pod.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@PODNAME@",
"labels":{},
"envVars:{},
"namespace":"default",
"containers":[
{
Expand Down

0 comments on commit 467470b

Please sign in to comment.