aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Hofrichter <joerg.hofrichter@ni.com>2020-11-10 10:46:12 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2020-11-11 10:52:07 -0600
commita61bbb55ebe6fddfe031e7f51bd6aebe706ac582 (patch)
tree8e240c1dc9a64c1664a244ac7f9e128c9d6baa3b
parent328c7a1fce67c7b5693407aab3295d81767dcba8 (diff)
downloaduhd-a61bbb55ebe6fddfe031e7f51bd6aebe706ac582.tar.gz
uhd-a61bbb55ebe6fddfe031e7f51bd6aebe706ac582.tar.bz2
uhd-a61bbb55ebe6fddfe031e7f51bd6aebe706ac582.zip
mpm: Fix issue with check-filesystem test execution
This fixes tests that are invoked with arguments `--dt-overlays-loaded`, `--dt-overlays-available`, `--systemd-init-successful`, and `--mpm-init-successful`. Without this fix, the following error is generated: `ERROR: test_mpm_init_successful (name '_assert_filesystem_root_is_not_set' is not defined)`
-rwxr-xr-xmpm/tools/check-filesystem12
1 files changed, 6 insertions, 6 deletions
diff --git a/mpm/tools/check-filesystem b/mpm/tools/check-filesystem
index 4129dddac..f824e88b2 100755
--- a/mpm/tools/check-filesystem
+++ b/mpm/tools/check-filesystem
@@ -40,8 +40,8 @@ class SimpleResult(unittest.TextTestResult):
% (flavour, self.getDescription(test), err))
class CheckFilesystem(unittest.TestCase):
- def _assert_filesystem_root_is_not_set():
- if self.args.filesystem_root:
+ def _assert_filesystem_root_is_not_set(self):
+ if self.args.filesystem_root != '/':
raise ValueError("Changing the filesystem root is not possible for this test")
def __init__(self, methodName='runTest', args=None):
@@ -79,7 +79,7 @@ class CheckFilesystem(unittest.TestCase):
self.assertEqual(opkg_status_md5sum, self.args.opkg_status_md5sum)
def test_dt_overlays_available(self):
- _assert_filesystem_root_is_not_set()
+ self._assert_filesystem_root_is_not_set()
dt_overlays_available = list_available_overlays()
dt_overlays_available.sort()
reference = parse_list(self.args.dt_overlays_available)
@@ -87,7 +87,7 @@ class CheckFilesystem(unittest.TestCase):
self.assertEqual(dt_overlays_available, reference)
def test_dt_overlays_loaded(self):
- _assert_filesystem_root_is_not_set()
+ self._assert_filesystem_root_is_not_set()
dt_overlays_loaded = list(list_overlays(applied_only=True).keys())
dt_overlays_loaded.sort()
reference = parse_list(self.args.dt_overlays_loaded)
@@ -95,13 +95,13 @@ class CheckFilesystem(unittest.TestCase):
self.assertEqual(dt_overlays_loaded, reference)
def test_systemd_init_successful(self):
- _assert_filesystem_root_is_not_set()
+ self._assert_filesystem_root_is_not_set()
output = subprocess.check_output(['systemctl', 'is-system-running']).decode('utf-8')
status = output.splitlines()[0]
self.assertEqual(status, 'running')
def test_mpm_init_successful(self):
- _assert_filesystem_root_is_not_set()
+ self._assert_filesystem_root_is_not_set()
p1 = subprocess.Popen(['echo', 'get_init_status'], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['mpm_shell.py', '-c', 'localhost'], stdin=p1.stdout,
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)