From 36e55a64f091108b5ac256fd0b81208dae27ea85 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 14 Jun 2023 17:00:35 +0200 Subject: [PATCH] Add manifest conditions Check for the existence of the podman.socket for the Cockpit client scenario. --- src/manifest.json | 3 +++ test/check-application | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/manifest.json b/src/manifest.json index 477d97afc..530aa6db8 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,4 +1,7 @@ { + "conditions": [ + {"path-exists": "/lib/systemd/system/podman.socket"} + ], "menu": { "index": { "label": "Podman containers", diff --git a/test/check-application b/test/check-application index 45f4f4d44..3f4f77904 100755 --- a/test/check-application +++ b/test/check-application @@ -2563,6 +2563,21 @@ class TestApplication(testlib.MachineCase): b.click(".pf-m-expanded button:contains('Logs')") b.wait_in_text(".pf-m-expanded .pf-c-empty-state__content", "failed to obtain logs for Container") + @testlib.skipOstree("/lib is read-only") + def testManifest(self): + b = self.browser + m = self.machine + self.restore_file("/lib/systemd/system/podman.socket", post_restore_action="systemctl daemon-reload") + m.execute("rm /lib/systemd/system/podman.socket") + self.login_and_go(None) + b.wait_in_text("#host-apps .pf-m-current", "Overview") + + # HACK: is_pybridge should also check TEST_SCENARIO + if self.is_pybridge() or os.getenv('TEST_SCENARIO') == 'pybridge': + self.assertNotIn("Podman", b.text("#host-apps")) + else: + self.assertIn("Podman", b.text("#host-apps")) + if __name__ == '__main__': testlib.test_main()