Files
containers/bitnami/node/test.sh
Sameer Naik 3bae43d870 Stacksmith merger (#42)
* switch to harpoon installer

* removed unused `installer.run.sha256`

* bump version to 5.5.0-1

* added sha256 hash for package verification

* switch to `gcr.io/stacksmith-images/ubuntu-buildpack:14.04` base image

* removed unused files

* switch to `gcr.io/stacksmith-images/ubuntu:14.04` base image

* organize dockerfile for stacksmith (#2)

* verify checksum in harpoon commands
* removed `BITNAMI_APP_DIR` macro
* organize dockerfile for stacksmith

* tests: fix python version test

* bump to node-5.10.1-0 (#3)

* Fixes (#4)

* tests: removed `npm install pg-native` test

* removed `WORKDIR` instruction

* update to node-5.11.0-0 (#6)

* upgrade to `gcr.io/stacksmith-images/ubuntu:14.04-r06`

* upgrade to node-5.11.0-0

* tests: fix python test

* upgrade to node-6.1.0-0

* cleanup dockerfile

* removed redundant `app-entrypoint.sh` script

* ignore `pkg-cache/` in git

* ignore `.git/` in docker builds

* restore `WORKDIR /app` instruction

* readme updates (#5)

* Add extra packages (#7)

* add `imagemagick` and `mysql-libraries` harpoon modules

* readme: fixes

* upgrade to `gcr.io/stacksmith-images/ubuntu:14.04-r07` baseimage

* set image version to 6.1.0-r0

* update node harpoon module -> `node-6.2.0-0`

* updated TLDR to launch `repl` in docker-cli command

* readme: import cwd as `/app` volume in `docker-compose` examples

* readme: mention use of user namespaces
2016-05-19 12:12:42 -07:00

83 lines
1.7 KiB
Bash

#!/usr/bin/env bats
# source the helper script
APP_NAME=node
SLEEP_TIME=3
load tests/docker_helper
# Cleans up all running/stopped containers
cleanup_environment() {
container_remove default
}
# Teardown called at the end of each test
teardown() {
cleanup_environment
}
# cleanup the environment before starting the tests
cleanup_environment
@test "node and npm installed" {
container_create default -id
run container_exec default npm -v
[ "$status" = 0 ]
run container_exec default node -v
[ "$status" = 0 ]
}
@test "python installed" {
container_create default -id
run container_exec default python3 --version
[ "$status" = 0 ]
}
@test "can install npm modules with system requirements" {
container_create default -id
run container_exec default npm install bower
[ "$status" = 0 ]
}
@test "can install global npm modules" {
container_create default -id
run container_exec default npm install -g node-static
[ "$status" = 0 ]
}
@test "port 3000 exposed" {
container_create default -id
# create sample express app
container_exec default sh -c "cat > /app/server.js <<EOF
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('The night is dark and full of terrors');
});
var server = app.listen(3000, '0.0.0.0', function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
EOF"
# install express
container_exec default npm install express
# start server
container_exec_detached default node server.js
sleep 5
# test connection on port 3000
run curl_client default http://node:3000/
[[ "$output" =~ "The night is dark and full of terrors" ]]
}