Commit 6816fe61 authored by Brendan Higgins's avatar Brendan Higgins Committed by Shuah Khan

kunit: tool: fix broken default args in unit tests

Commit ddbd60c7 ("kunit: use --build_dir=.kunit as default") changed
the default build directory for KUnit tests, but failed to update
associated unit tests for kunit_tool, so update them.

Fixes: ddbd60c7 ("kunit: use --build_dir=.kunit as default")
Signed-off-by: default avatarBrendan Higgins <brendanhiggins@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 5a9fcad7
...@@ -247,14 +247,14 @@ class KUnitMainTest(unittest.TestCase): ...@@ -247,14 +247,14 @@ class KUnitMainTest(unittest.TestCase):
def test_build_passes_args_pass(self): def test_build_passes_args_pass(self):
kunit.main(['build'], self.linux_source_mock) kunit.main(['build'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0 assert self.linux_source_mock.build_reconfig.call_count == 0
self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '', None) self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '.kunit', None)
assert self.linux_source_mock.run_kernel.call_count == 0 assert self.linux_source_mock.run_kernel.call_count == 0
def test_exec_passes_args_pass(self): def test_exec_passes_args_pass(self):
kunit.main(['exec'], self.linux_source_mock) kunit.main(['exec'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0 assert self.linux_source_mock.build_reconfig.call_count == 0
assert self.linux_source_mock.run_kernel.call_count == 1 assert self.linux_source_mock.run_kernel.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=300) self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.')) self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_passes_args_pass(self): def test_run_passes_args_pass(self):
...@@ -262,7 +262,7 @@ class KUnitMainTest(unittest.TestCase): ...@@ -262,7 +262,7 @@ class KUnitMainTest(unittest.TestCase):
assert self.linux_source_mock.build_reconfig.call_count == 1 assert self.linux_source_mock.build_reconfig.call_count == 1
assert self.linux_source_mock.run_kernel.call_count == 1 assert self.linux_source_mock.run_kernel.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with( self.linux_source_mock.run_kernel.assert_called_once_with(
build_dir='', timeout=300) build_dir='.kunit', timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.')) self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_exec_passes_args_fail(self): def test_exec_passes_args_fail(self):
...@@ -302,7 +302,7 @@ class KUnitMainTest(unittest.TestCase): ...@@ -302,7 +302,7 @@ class KUnitMainTest(unittest.TestCase):
def test_exec_timeout(self): def test_exec_timeout(self):
timeout = 3453 timeout = 3453
kunit.main(['exec', '--timeout', str(timeout)], self.linux_source_mock) kunit.main(['exec', '--timeout', str(timeout)], self.linux_source_mock)
self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=timeout) self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.')) self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_timeout(self): def test_run_timeout(self):
...@@ -310,7 +310,7 @@ class KUnitMainTest(unittest.TestCase): ...@@ -310,7 +310,7 @@ class KUnitMainTest(unittest.TestCase):
kunit.main(['run', '--timeout', str(timeout)], self.linux_source_mock) kunit.main(['run', '--timeout', str(timeout)], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 1 assert self.linux_source_mock.build_reconfig.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with( self.linux_source_mock.run_kernel.assert_called_once_with(
build_dir='', timeout=timeout) build_dir='.kunit', timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.')) self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_builddir(self): def test_run_builddir(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment