Skip to content

Commit

Permalink
test added :)
Browse files Browse the repository at this point in the history
  • Loading branch information
fscm committed Nov 7, 2019
1 parent c1556b8 commit 55fec52
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.4"

services:
sut:
build:
context: .
dockerfile: ./Dockerfile
entrypoint: [""]
command: ["/usr/bin/in_sanity"]
72 changes: 72 additions & 0 deletions files/tests/in_sanity
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh
#
# Shell script to test the MongoDB Docker image.
#
# Copyright 2016-2019, Frederico Martins
# Author: Frederico Martins <http:https://github.com/fscm>
#
# SPDX-License-Identifier: MIT
#
# This program is free software. You can use it and/or modify it under the
# terms of the MIT License.
#

# Variables

echo "=== Docker Build Test ==="

echo -n "[TEST] Check if iptables is installed... "
iptables --version > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 1
fi

echo -n "[TEST] Check if OpenSSL is installed... "
openssl version > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 2
fi

echo -n "[TEST] Check if Root Certificates are installed... "
(echo | openssl s_client -connect google.com:443 2>&1) | grep -q 'Verify return code: 0 (ok)'
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 3
fi

echo -n "[TEST] Check if OpenVPN is installed... "
openvpn --show-ciphers > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 4
fi

echo -n "[TEST] Check if Python is installed... "
python --version > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 5
fi

echo -n "[TEST] Check if Pritunl is installed... "
pritunl version > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
echo 'OK'
else
echo 'Failed'
exit 6
fi

exit 0

0 comments on commit 55fec52

Please sign in to comment.