tests: removed the default -d argument from create_basic_container function

This commit is contained in:
Sameer Naik
2015-09-09 19:31:03 +05:30
parent 44f091258b
commit 3928f922f4

View File

@@ -32,7 +32,7 @@ cleanup_volumes_content() {
} }
create_basic_container(){ create_basic_container(){
docker run -d "$@" $IMAGE_NAME; sleep $SLEEP_TIME docker run "$@" $IMAGE_NAME; sleep $SLEEP_TIME
} }
# $1 is the command # $1 is the command
@@ -61,7 +61,7 @@ create_full_container_mounted(){
} }
@test "Root user created without password" { @test "Root user created without password" {
create_basic_container --name $CONTAINER_NAME create_basic_container -d --name $CONTAINER_NAME
run mysql_client -e "select User from mysql.user where User=\"root\"\G" run mysql_client -e "select User from mysql.user where User=\"root\"\G"
[[ "$output" =~ "User: root" ]] [[ "$output" =~ "User: root" ]]
} }
@@ -77,7 +77,7 @@ create_full_container_mounted(){
} }
@test "Root user has access to admin database" { @test "Root user has access to admin database" {
create_basic_container --name $CONTAINER_NAME create_basic_container -d --name $CONTAINER_NAME
run mysql_client -e 'show databases\G' run mysql_client -e 'show databases\G'
[[ "$output" =~ 'Database: mysql' ]] [[ "$output" =~ 'Database: mysql' ]]
} }
@@ -148,7 +148,7 @@ create_full_container_mounted(){
} }
@test "Port 3306 exposed and accepting external connections" { @test "Port 3306 exposed and accepting external connections" {
create_basic_container --name $CONTAINER_NAME create_basic_container -d --name $CONTAINER_NAME
run docker run --rm --name 'linked' --link $CONTAINER_NAME:$CONTAINER_NAME $IMAGE_NAME\ run docker run --rm --name 'linked' --link $CONTAINER_NAME:$CONTAINER_NAME $IMAGE_NAME\
mysql -h $CONTAINER_NAME -P 3306 -e 'show databases\G' mysql -h $CONTAINER_NAME -P 3306 -e 'show databases\G'
@@ -156,7 +156,7 @@ create_full_container_mounted(){
} }
@test "All the volumes exposed" { @test "All the volumes exposed" {
create_basic_container --name $CONTAINER_NAME create_basic_container -d --name $CONTAINER_NAME
run docker inspect $CONTAINER_NAME run docker inspect $CONTAINER_NAME
[[ "$output" =~ "$VOL_PREFIX/data" ]] [[ "$output" =~ "$VOL_PREFIX/data" ]]
[[ "$output" =~ "$VOL_PREFIX/conf" ]] [[ "$output" =~ "$VOL_PREFIX/conf" ]]