Skip to content

Commit 1df8073

Browse files
authored
Merge pull request #4492 from branfosj/bash
switch from `ls` to `bash` in tests that are expecting this to be a binary
2 parents 24a0f8a + f8c683b commit 1df8073

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/framework/filetools.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ def test_is_binary(self):
924924

925925
self.assertTrue(ft.is_binary(b'\00'))
926926
self.assertTrue(ft.is_binary(b"File is binary when it includes \00 somewhere"))
927-
self.assertTrue(ft.is_binary(ft.read_file('/bin/ls', mode='rb')))
927+
self.assertTrue(ft.is_binary(ft.read_file('/bin/bash', mode='rb')))
928928

929929
def test_det_patched_files(self):
930930
"""Test det_patched_files function."""

test/framework/systemtools.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1033,15 +1033,15 @@ def test_check_linked_shared_libs(self):
10331033
self.assertEqual(check_linked_shared_libs(txt_path), None)
10341034
self.assertEqual(check_linked_shared_libs(broken_symlink_path), None)
10351035

1036-
bin_ls_path = which('ls')
1036+
bin_bash_path = which('bash')
10371037

10381038
os_type = get_os_type()
10391039
if os_type == LINUX:
10401040
with self.mocked_stdout_stderr():
1041-
res = run_shell_cmd("ldd %s" % bin_ls_path)
1041+
res = run_shell_cmd("ldd %s" % bin_bash_path)
10421042
elif os_type == DARWIN:
10431043
with self.mocked_stdout_stderr():
1044-
res = run_shell_cmd("otool -L %s" % bin_ls_path)
1044+
res = run_shell_cmd("otool -L %s" % bin_bash_path)
10451045
else:
10461046
raise EasyBuildError("Unknown OS type: %s" % os_type)
10471047

@@ -1061,7 +1061,7 @@ def test_check_linked_shared_libs(self):
10611061
self.assertEqual(check_linked_shared_libs(self.test_prefix, **pattern_named_args), None)
10621062
self.assertEqual(check_linked_shared_libs(txt_path, **pattern_named_args), None)
10631063
self.assertEqual(check_linked_shared_libs(broken_symlink_path, **pattern_named_args), None)
1064-
for path in (bin_ls_path, lib_path):
1064+
for path in (bin_bash_path, lib_path):
10651065
# path may not exist, especially for library paths obtained via 'otool -L' on macOS
10661066
if os.path.exists(path):
10671067
error_msg = "Check on linked libs should pass for %s with %s" % (path, pattern_named_args)
@@ -1078,7 +1078,7 @@ def test_check_linked_shared_libs(self):
10781078
self.assertEqual(check_linked_shared_libs(self.test_prefix, **pattern_named_args), None)
10791079
self.assertEqual(check_linked_shared_libs(txt_path, **pattern_named_args), None)
10801080
self.assertEqual(check_linked_shared_libs(broken_symlink_path, **pattern_named_args), None)
1081-
for path in (bin_ls_path, lib_path):
1081+
for path in (bin_bash_path, lib_path):
10821082
error_msg = "Check on linked libs should fail for %s with %s" % (path, pattern_named_args)
10831083
self.assertFalse(check_linked_shared_libs(path, **pattern_named_args), error_msg)
10841084

0 commit comments

Comments
 (0)