mirror of
https://github.com/bitnami/containers.git
synced 2026-03-10 15:09:17 +08:00
0.12.4-2 version + tests
This commit is contained in:
48
bitnami/node/test.sh
Normal file
48
bitnami/node/test.sh
Normal 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" ]]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user