From 9c1afd256a2aba7cba64953632b4262db964e41d Mon Sep 17 00:00:00 2001 From: Jan Scotka Date: Mar 31 2017 08:10:38 +0000 Subject: [PATCH 1/2] moved checking ENV variable to functions to allow override them --- diff --git a/moduleframework/module_framework.py b/moduleframework/module_framework.py index 79244f0..1f6000b 100644 --- a/moduleframework/module_framework.py +++ b/moduleframework/module_framework.py @@ -23,6 +23,7 @@ def skipTestIf(value, text="Test not intended for this module profile"): raise exceptions.TestDecoratorSkip(text) class CommonFunctions(): + config = None def runHost(self, command="ls /", **kwargs): return utils.process.run("%s" % command, **kwargs) @@ -47,6 +48,8 @@ class CommonFunctions(): cconfig = yaml.load(ymlfile) return cconfig else: + if self.config is None: + self.loadconfig() if not self.__modulemdConf: ymlfile = urllib.urlopen(get_correct_modulemd()) self.__modulemdConf = yaml.load(ymlfile) @@ -340,7 +343,8 @@ class RpmAvocadoTest(AvocadoTest): self.skip("Rpm specific test") -def get_correct_backend(amodule=os.environ.get('MODULE')): +def get_correct_backend(): + amodule = os.environ.get('MODULE') readconfig = CommonFunctions() readconfig.loadconfig() if readconfig.config.has_key("default_module") and readconfig.config["default_module"] is not None and amodule == None: @@ -352,15 +356,18 @@ def get_correct_backend(amodule=os.environ.get('MODULE')): else: raise ValueError("Unsupported MODULE={0}".format(amodule)) -def get_correct_profile(amodule=os.environ.get('PROFILE')): +def get_correct_profile(): + amodule = os.environ.get('PROFILE') if not amodule: amodule="default" return amodule -def get_correct_url(amodule=os.environ.get('URL')): +def get_correct_url(): + amodule = os.environ.get('URL') return amodule -def get_correct_config(cfgfile=os.environ.get('CONFIG')): +def get_correct_config(): + cfgfile = os.environ.get('CONFIG') if not cfgfile: cfgfile="config.yaml" if not os.path.exists(cfgfile): @@ -371,7 +378,8 @@ def get_correct_config(cfgfile=os.environ.get('CONFIG')): raise ValueError("Bad Config file, not yaml or does not contain proper document type" % cfgfile) return xcfg -def get_correct_modulemd(mdf=os.environ.get('MODULEMDURL')): +def get_correct_modulemd(): + mdf = os.environ.get('MODULEMDURL') readconfig = CommonFunctions() readconfig.loadconfig() if mdf: From dffa96a3d51203d81b75bdc2b05b8f96e088f865 Mon Sep 17 00:00:00 2001 From: Jan Scotka Date: Mar 31 2017 08:15:07 +0000 Subject: [PATCH 2/2] Automatic commit of package [modularity-testing-framework] release [0.2.1-1]. Created by command: /usr/bin/tito tag --- diff --git a/.tito/packages/modularity-testing-framework b/.tito/packages/modularity-testing-framework index 9c1ed39..590f726 100644 --- a/.tito/packages/modularity-testing-framework +++ b/.tito/packages/modularity-testing-framework @@ -1 +1 @@ -0.1.9-1 ./ +0.2.1-1 ./ diff --git a/modularity-testing-framework.spec b/modularity-testing-framework.spec index f996b0a..7c41051 100644 --- a/modularity-testing-framework.spec +++ b/modularity-testing-framework.spec @@ -1,5 +1,5 @@ Name: modularity-testing-framework -Version: 0.2.0 +Version: 0.2.1 Release: 1%{?dist} Summary: Framework for writing tests for modules and containers @@ -41,6 +41,23 @@ install -d -m 755 %{buildroot}%{_datadir}/moduleframework %changelog +* Fri Mar 31 2017 Jan Scotka 0.2.1-1 +- moved checking ENV variable to functions to allow override them + (jscotka@redhat.com) +- added possibility to pass file via parameter, not just via stdin, could be + cleaner solution (jscotka@redhat.com) +- moved skipping of module to specific class (jscotka@redhat.com) +- removed typo in README file (jscotka@redhat.com) +- move xunit log to avocado directory (jscotka@redhat.com) +- typo, redefinig avocado function, it is bad bad bad (jscotka@redhat.com) +- changed to executable (jscotka@redhat.com) +- added scripts to help with taskotron integration (jscotka@redhat.com) +- added scripts to help with taskotron integration (jscotka@redhat.com) +- added scripts to help with taskotron integration (jscotka@redhat.com) +- added simple tests for ngnix (jscotka@redhat.com) +- Typo in version (phracek@redhat.com) +- Bump version (phracek@redhat.com) + * Fri Mar 24 2017 Petr Hracek - 0.2.0-1 - New upstream version