From 0f9625779c4e1b3e09716bf8ae16cc7161b81221 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Apr 25 2017 08:13:13 +0000 Subject: add basic tests --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bbb25bf --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +IMAGE_NAME = nginx + +MODULEMDURL=file://nginx.yaml + +default: run + +build: + docker build --tag=$(IMAGE_NAME) . + +run: build + docker run -d $(IMAGE_NAME) + +test: build + cd tests; MODULE=docker MODULEMD=$(MODULEMDURL) URL="docker=$(IMAGE_NAME)" make all + cd tests; MODULE=rpm MODULEMD=$(MODULEMDURL) URL="docker=$(IMAGE_NAME)" make all diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..fa94987 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,7 @@ +MODULE_LINT=/usr/share/moduleframework/tools/modulelint.py +CMD=python -m avocado run --filter-by-tags=-WIP $(MODULE_LINT) *.py + +# +all: + generator + $(CMD) diff --git a/tests/config.yaml b/tests/config.yaml new file mode 100644 index 0000000..9b9e3ee --- /dev/null +++ b/tests/config.yaml @@ -0,0 +1,29 @@ +document: modularity-testing +version: 1 +name: nginx +modulemd-url: http://raw.githubusercontent.com/container-images/nginx/master/nginx.yaml +service: + port: 80 +packages: + rpms: + - nginx +testdependecies: + rpms: + - curl +module: + docker: + start: "docker run --rm -p 80:80 nginx" + source: https://github.com/container-images/nginx.git + container: docker.io/modularitycontainers/nginx + rpm: + start: systemctl start nginx + stop: systemctl stop nginx + status: systemctl status nginx + repos: + - http://mirror.vutbr.cz/fedora/releases/25/Everything/x86_64/os/ +test: + processrunning: + - 'ls /proc/*/exe -alh | grep nginx' +testhost: + basic: + - 'curl localhost | grep "Welcome to nginx!"'