[jscotka@localhost tmp]$ cd /usr/share/moduleframework/examples/memcached [jscotka@localhost memcached]$ ls config.yaml Makefile metadata.yaml sanity1.py sanity1.pyc sanity1.pyo [jscotka@localhost memcached]$ sudo MODULE=docker mtf-env-set Setting environment for module: docker Preparing environment ... Loaded config for name: memcached Installs test dependencies: ['nc'] [jscotka@localhost memcached]$ sudo MODULE=docker mtf *.py JOB ID : 2523702e1ab6aa707f48b4289ad159c268c28697 JOB LOG : /root/avocado/job-results/job-2018-01-22T17.31-2523702/job.log (1/2) sanity1.py:SanityCheck1.test1: PASS (59.30 s) (2/2) sanity1.py:SanityCheck1.test2: PASS (15.09 s) RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 75.83 s JOB HTML : /root/avocado/job-results/job-2018-01-22T17.31-2523702/results.html [jscotka@localhost memcached]$ cat config.yaml document: meta-test version: 1 name: memcached modulemd-url: https://src.fedoraproject.org/modules/memcached/raw/master/f/memcached.yaml service: port: 11211 packages: rpms: - memcached - perl-Carp testdependencies: rpms: - nc module: openshift: container: docker.io/modularitycontainers/memcached docker: start: "docker run -it -e CACHE_SIZE=128 -p 11211:11211" labels: description: "memcached is a high-performance, distributed memory" io.k8s.description: "memcached is a high-performance, distributed memory" source: https://github.com/container-images/memcached.git container: docker.io/modularitycontainers/memcached rpm: start: systemctl start memcached stop: systemctl stop memcached status: systemctl status memcached url: https://kojipkgs.fedoraproject.org/compose/latest-Fedora-Modular-26/compose/Server/x86_64/os/ test: processrunning: - 'ls /proc/*/exe -alh | grep memcached' testhost: selfcheck: - 'echo errr | nc localhost 11211' - 'echo set AAA 0 4 2 | nc localhost 11211' - 'echo get AAA | nc localhost 11211' selcheckError: - 'echo errr | nc localhost 11211 |grep ERROR' [jscotka@localhost memcached]$ sudo mtf-generator Traceback (most recent call last): File "/bin/mtf-generator", line 11, in load_entry_point('meta-test-family==0.7.10', 'console_scripts', 'mtf-generator')() File "/usr/lib/python2.7/site-packages/moduleframework/mtf_generator.py", line 98, in main config = TestGenerator() File "/usr/lib/python2.7/site-packages/moduleframework/mtf_generator.py", line 44, in __init__ self.loadconfig() File "/usr/lib/python2.7/site-packages/moduleframework/common.py", line 415, in loadconfig self.info = self.config.get("module", {}).get(get_module_type_base()) File "/usr/lib/python2.7/site-packages/moduleframework/common.py", line 861, in get_module_type_base module_type = get_module_type() File "/usr/lib/python2.7/site-packages/moduleframework/common.py", line 852, in get_module_type "supported are: %s" % list_modules_from_config()) moduleframework.mtfexceptions.ModuleFrameworkException: EXCEPTION MTF: ('Unsupported MODULE=None', "supported are: ['docker', 'rpm', 'openshift', 'nspawn']") !!!!!!!!!!!!!!! MISSING MODULE TYPE [jscotka@localhost memcached]$ sudo MODULE=docker mtf-generator Added test (runmethod: run): processrunning Added test (runmethod: runHost): selcheckError Added test (runmethod: runHost): selfcheck [jscotka@localhost memcached]$ ls config.yaml Makefile sanity1.py sanity1.pyo generated.py metadata.yaml sanity1.pyc [jscotka@localhost memcached]$ sudo MODULE=docker mtf *.py JOB ID : 90a0d287b8bb60ed12bddd857d7fa6d6f8b76db5 JOB LOG : /root/avocado/job-results/job-2018-01-22T17.35-90a0d28/job.log (1/5) generated.py:GeneratedTestsConfig.test_processrunning: PASS (15.29 s) (2/5) generated.py:GeneratedTestsConfig.test_selcheckError: PASS (15.01 s) (3/5) generated.py:GeneratedTestsConfig.test_selfcheck: PASS (14.94 s) (4/5) sanity1.py:SanityCheck1.test1: PASS (20.31 s) (5/5) sanity1.py:SanityCheck1.test2: PASS (14.97 s) RESULTS : PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 83.04 s JOB HTML : /root/avocado/job-results/job-2018-01-22T17.35-90a0d28/results.html [jscotka@localhost memcached]$ cat sanity1.py # -*- coding: utf-8 -*- # # Meta test family (MTF) is a tool to test components of a modular Fedora: # https://docs.pagure.org/modularity/ # Copyright (C) 2017 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # he Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Authors: Jan Scotka # import socket from avocado import main from avocado.core import exceptions from moduleframework import module_framework from moduleframework import common import time class SanityCheck1(module_framework.AvocadoTest): """ :avocado: enable """ def test1(self): self.start() time.sleep(5) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((self.ip_address, self.getConfig()['service']['port'])) s.sendall('set Test 0 100 4\r\n\n') s.sendall('JournalDev\r\n\n') data = s.recv(1024) common.print_info(data) s.close() def test2(self): self.start() self.run("ls / | grep bin") if __name__ == '__main__': main() [jscotka@localhost memcached]$