0.12.4-2 version + tests

This commit is contained in:
Miguel Martinez
2015-06-18 14:27:39 -07:00
parent e8c3b14481
commit d23bacb672
3 changed files with 50 additions and 2 deletions

48
bitnami/node/test.sh Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bats
CONTAINER_NAME=node-test
IMAGE_NAME=bitnami/node
SLEEP_TIME=3
VOL_PREFIX=/bitnami/$CONTAINER_NAME
create_container(){
docker run -itd --name $CONTAINER_NAME $IMAGE_NAME
sleep $SLEEP_TIME
}
setup () {
create_container
}
teardown() {
if [ "$(docker ps -a | grep $CONTAINER_NAME)" ]; then
docker rm -fv $CONTAINER_NAME
fi
}
@test "node and npm in the path" {
run docker exec $CONTAINER_NAME npm -v
[ "$status" = 0 ]
run docker exec $CONTAINER_NAME node -v
[ "$status" = 0 ]
}
@test "python in the path" {
skip
run docker exec $CONTAINER_NAME python -v
[ "$status" = 0 ]
}
@test "can install npm modules with system requirements" {
run docker exec $CONTAINER_NAME\
# test npm modules
npm install imagemagick-native express bower
[ "$status" = 0 ]
}
@test "All the volumes exposed" {
docker inspect $CONTAINER_NAME | {
run grep "\"Volumes\":" -A 1
[[ "$output" =~ "/app" ]]
}
}