From 92fcf2522e6e7a6bdaeccf494433a44ab2d679dd Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Sep 04 2017 17:48:38 +0000 Subject: Update tests. Keep watching a workflow with modularity-testing-framework will be stable. --- diff --git a/Dockerfile b/Dockerfile index f88c3b6..75809f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,16 @@ -FROM registry.fedoraproject.org/fedora:26 +# A workflow with docker is still uncertain. +# Keep watching below file and other module's situation. +# https://github.com/container-images/container-image-template/blob/master/Dockerfile.template +FROM registry.fedoraproject.org/f26-modular/boltron -# ruby image for OpenShift. -# -# Environment: +WORKDIR /build +COPY . . -ENV NAME=ruby ARCH=x86_64 -LABEL MAINTAINER "Jun Aruga" -LABEL summary="An interpreter of object-oriented scripting language" \ - name="$FGC/$NAME" \ - version="0" \ - release="1.$DISTTAG" \ - architecture="$ARCH" \ - com.redhat.component=$NAME \ - usage="docker run f26/ruby" \ - help="Runs ruby. No dependencies. See Help File below for more details." \ - description="An interpreter of object-oriented scripting language" \ - io.k8s.description="An interpreter of object-oriented scripting language" \ - io.k8s.diplay-name="Ruby 2.4 " \ - io.openshift.tags="ruby" +ENV LC_CTYPE C.UTF-8 -RUN dnf install -y --setopt=tsflags=nodocs ruby && \ - dnf -y clean all - -# ruby will be run under standard user on Fedora -USER 1000 +RUN dnf -y update +RUN dnf -y --nodocs install \ + ruby \ + && dnf -y clean all CMD /bin/bash diff --git a/Makefile b/Makefile index ef96813..896a9c5 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,8 @@ -IMAGE_NAME = ruby - -MODULEMDURL=file://ruby.yaml - -default: run +default: test 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 + docker build -t ruby . + docker run -d ruby +test: + $(MAKE) -C tests $@ diff --git a/tests/Makefile b/tests/Makefile index 6060723..6595113 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,7 +1,14 @@ -MODULE_LINT=/usr/share/moduleframework/tools/modulelint.py -# --filter-by-tags=-WIP: ignore WIP tag test that have a issue on F25 avocado. -CMD=python -m avocado run --filter-by-tags=-WIP $(MODULE_LINT) *.py - +# A workflow with modularity-testing-framework is still uncertain. +# Only nspawn is actually used. +# https://meta-test-family.readthedocs.io/en/latest/index.html # -all: - $(CMD) +# Installation +# $ sudo dnf install modularity-testing-framework python2-avocado +# $ sudo /usr/bin/pip install behave +test: + mtf-generator + MODULE=nspawn \ + python -d -m avocado run \ + --filter-by-tags=-WIP \ + /usr/share/moduleframework/tools/modulelint.py \ + *.py diff --git a/tests/config.yaml b/tests/config.yaml index 14c3078..ec3708c 100644 --- a/tests/config.yaml +++ b/tests/config.yaml @@ -2,20 +2,10 @@ document: modularity-testing version: 1 name: ruby modulemd-url: https://src.fedoraproject.org/cgit/modules/ruby.git/plain/ruby.yaml -service: - port: 8080 -packages: - rpms: - # add which here because of the issue. - # https://pagure.io/modularity-testing-framework/issue/45 - - ruby -testdependecies: - rpms: - - which - - hostname module: - docker: - container: docker.io/ruby rpm: repos: - - http://mirror.vutbr.cz/fedora/releases/25/Everything/x86_64/os/ + - http://mirror.vutbr.cz/fedora/releases/26/Everything/x86_64/os/ +test: + version: + - 'ruby -v' diff --git a/tests/ruby_tests.py b/tests/ruby_tests.py deleted file mode 100644 index ce9bbd5..0000000 --- a/tests/ruby_tests.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python - -import socket -from avocado import main -from moduleframework import module_framework - -class RubyTests(module_framework.AvocadoTest): - """ - :avocado: enable - """ - - def test_cmd(self): - self.start() - self.run("which ruby") - - def test_version(self): - self.start() - self.run("ruby -v") - - def test_hostname(self): - self.start() - self.run("hostname") - - -if __name__ == '__main__': - main()