Skip to content

Commit 75d4e53

Browse files
authored
Merge pull request #7101 from BOINC/vko_fix_linux_package_tests
[ci] fix linux package tests
2 parents 3d7ffcb + 219ce30 commit 75d4e53

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

tests/linux_package_integration_tests.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,15 @@ def _get_file_owner(self, filename):
108108
path = pathlib.Path(filename)
109109
return "{owner}:{group}".format(owner=path.owner(), group=path.group())
110110

111-
def _get_ca_certificates_file_path(self):
111+
def _get_ca_certificates_file_paths(self):
112+
paths = []
112113
if os.path.exists("/etc/ssl/certs/ca-certificates.crt"):
113-
return "/etc/ssl/certs/ca-certificates.crt"
114+
paths.append("/etc/ssl/certs/ca-certificates.crt")
114115
if os.path.exists("/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"):
115-
return "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"
116+
paths.append("/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem")
116117
if os.path.exists("/etc/ssl/ca-bundle.pem"):
117-
return "/etc/ssl/ca-bundle.pem"
118-
return ""
118+
paths.append("/etc/ssl/ca-bundle.pem")
119+
return paths
119120

120121
def test_files_exist(self):
121122
ts = testset.TestSet("Test files exist")
@@ -162,10 +163,10 @@ def test_files_exist(self):
162163
ts.expect_equal("/etc/boinc-client/gui_rpc_auth.cfg", os.readlink("/var/lib/boinc/gui_rpc_auth.cfg"), "Test '/var/lib/boinc/gui_rpc_auth.cfg' file is a symbolic link to '/etc/boinc-client/gui_rpc_auth.cfg'")
163164
else:
164165
ts.expect_true(False, "Test 'gui_rpc_auth.cfg' file is a symbolic link")
165-
ts.expect_not_equal("", self._get_ca_certificates_file_path(), "Test system 'ca-certificates.crt' file exists")
166+
ts.expect_true(len(self._get_ca_certificates_file_paths()) > 0, "Test system 'ca-certificates.crt' file exists")
166167
ts.expect_true(os.path.exists("/var/lib/boinc/ca-bundle.crt"), "Test 'ca-bundle.crt' file exists in '/var/lib/boinc/'")
167168
ts.expect_true(os.path.islink("/var/lib/boinc/ca-bundle.crt"), "Test '/var/lib/boinc/ca-bundle.crt' file is a symbolic link")
168-
ts.expect_equal(self._get_ca_certificates_file_path(), os.readlink("/var/lib/boinc/ca-bundle.crt"), "Test '/var/lib/boinc/ca-bundle.crt' file is a symbolic link to the system 'ca-certificates.crt' file")
169+
ts.expect_true(os.readlink("/var/lib/boinc/ca-bundle.crt") in self._get_ca_certificates_file_paths(), "Test '/var/lib/boinc/ca-bundle.crt' file is a symbolic link to the system 'ca-certificates.crt' file")
169170
ts.expect_true(os.path.exists("/var/lib/boinc/all_projects_list.xml"), "Test 'all_projects_list.xml' file exists in '/var/lib/boinc/'")
170171
return ts.result()
171172

0 commit comments

Comments
 (0)