From 59c162d46fccfacd934b59cf13be5e323ef95f0f Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Mon, 11 Dec 2017 17:30:37 +0100 Subject: [PATCH] Remove strace from buildinstall runroot The package is not really needed. Relates: https://pagure.io/pungi/issue/799 Signed-off-by: Ondrej Nosek --- doc/contributing.rst | 2 +- pungi/phases/buildinstall.py | 2 +- tests/test_buildinstall.py | 10 ++++------ tests/test_koji_wrapper.py | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/contributing.rst b/doc/contributing.rst index 65ffae9b..a6c6f99e 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -55,7 +55,7 @@ packages above as they are used by calling an executable. :: $ for pkg in _deltarpm krbV _selinux deltarpm sqlitecachec _sqlitecache; do ln -vs "$(deactivate && python -c 'import os, '$pkg'; print '$pkg'.__file__')" "$(virtualenvwrapper_get_site_packages_dir)"; done $ pip install -U pip $ PYCURL_SSL_LIBRARY=nss pip install pycurl --no-binary :all: - $ pip install jsonschema kobo==0.60 lockfile lxml mock nose nose-cov productmd pyopenssl python-multilib requests setuptools sphinx + $ pip install jsonschema kobo==0.6.0 lockfile lxml mock nose nose-cov productmd pyopenssl python-multilib requests setuptools sphinx Now you should be able to run all existing tests. diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index bbc06ae6..001b78bc 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -420,7 +420,7 @@ class BuildinstallThread(WorkerThread): task_id = None if runroot: # run in a koji build root - packages = ["strace"] + packages = [] if buildinstall_method == "lorax": packages += ["lorax"] elif buildinstall_method == "buildinstall": diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 450c9a19..335b0d2d 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -344,7 +344,6 @@ class TestBuildinstallPhase(PungiTestCase): mock.call(compose, 'amd64', variant=compose.variants['Client'], disc_type='dvd'), mock.call(compose, 'amd64', variant=compose.variants['Server'], disc_type='dvd')]) - @mock.patch('pungi.phases.buildinstall.ThreadPool') @mock.patch('pungi.phases.buildinstall.LoraxWrapper') @mock.patch('pungi.phases.buildinstall.get_volid') @@ -627,7 +626,7 @@ class BuildinstallThreadTestCase(PungiTestCase): get_runroot_cmd.mock_calls, [mock.call('rrt', 'x86_64', self.cmd, channel=None, use_shell=True, task_id=True, - packages=['strace', 'lorax'], mounts=[self.topdir], weight=123)]) + packages=['lorax'], mounts=[self.topdir], weight=123)]) self.assertItemsEqual( run_runroot_cmd.mock_calls, [mock.call(get_runroot_cmd.return_value, @@ -668,7 +667,7 @@ class BuildinstallThreadTestCase(PungiTestCase): get_runroot_cmd.mock_calls, [mock.call('rrt', 'x86_64', self.cmd, channel=None, use_shell=True, task_id=True, - packages=['strace', 'anaconda'], mounts=[self.topdir], weight=None)]) + packages=['anaconda'], mounts=[self.topdir], weight=None)]) self.assertItemsEqual( run_runroot_cmd.mock_calls, [mock.call(get_runroot_cmd.return_value, @@ -811,7 +810,7 @@ class BuildinstallThreadTestCase(PungiTestCase): get_runroot_cmd.mock_calls, [mock.call('rrt', 'x86_64', self.cmd, channel=None, use_shell=True, task_id=True, - packages=['strace', 'lorax'], mounts=[self.topdir], weight=123)]) + packages=['lorax'], mounts=[self.topdir], weight=123)]) self.assertItemsEqual( run_runroot_cmd.mock_calls, [mock.call(get_runroot_cmd.return_value, @@ -828,8 +827,7 @@ class BuildinstallThreadTestCase(PungiTestCase): [mock.call(os.path.join(buildinstall_topdir, 'x86_64/Server/results'), os.path.join(self.topdir, 'work/x86_64/buildinstall/Server')), mock.call(os.path.join(buildinstall_topdir, 'x86_64/Server/logs'), - os.path.join(self.topdir, 'logs/x86_64/buildinstall-Server-logs')) - ] + os.path.join(self.topdir, 'logs/x86_64/buildinstall-Server-logs'))] ) diff --git a/tests/test_koji_wrapper.py b/tests/test_koji_wrapper.py index 4128a382..13f2aec0 100644 --- a/tests/test_koji_wrapper.py +++ b/tests/test_koji_wrapper.py @@ -371,7 +371,7 @@ class RunrootKojiWrapperTest(KojiWrapperBaseTestCase): def test_get_cmd_full(self): cmd = self.koji.get_runroot_cmd('tgt', 's390x', ['/bin/echo', '&'], quiet=True, channel='chan', - packages=['strace', 'lorax'], + packages=['lorax', 'some_other_package'], mounts=['/tmp'], weight=1000) self.assertEqual(len(cmd), 14) self.assertEqual(cmd[:3], ['koji', '--profile=custom-koji', 'runroot']) @@ -380,7 +380,7 @@ class RunrootKojiWrapperTest(KojiWrapperBaseTestCase): self.assertEqual(cmd[-1], 'rm -f /var/lib/rpm/__db*; rm -rf /var/cache/yum/*; set -x; /bin/echo \'&\'') self.assertItemsEqual(cmd[3:-3], ['--channel-override=chan', '--quiet', '--use-shell', - '--task-id', '--weight=1000', '--package=strace', + '--task-id', '--weight=1000', '--package=some_other_package', '--package=lorax', '--mount=/tmp']) @mock.patch('pungi.wrappers.kojiwrapper.run')