From c7f1827e9c47db2f2a38ffce3655fcbef65d7a3d Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 28 Aug 2024 12:51:02 +0300 Subject: [PATCH] storage: Never install packages on-demand in Anaconda mode --- pkg/storaged/client.js | 4 ++++ test/common/testlib.py | 10 ++++++++++ test/verify/check-storage-anaconda | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/pkg/storaged/client.js b/pkg/storaged/client.js index 628c66f5d15..b6128a3d58d 100644 --- a/pkg/storaged/client.js +++ b/pkg/storaged/client.js @@ -960,6 +960,10 @@ function init_model(callback) { } function enable_pk_features() { + if (client.in_anaconda_mode()) { + client.features.packagekit = false; + return Promise.resolve(); + } return PK.detect().then(function (available) { client.features.packagekit = available }); } diff --git a/test/common/testlib.py b/test/common/testlib.py index 643a277b329..2b478c7cd6d 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -73,6 +73,7 @@ 'arg_parser', 'no_retry_when_changed', 'nondestructive', + 'destructive', 'onlyImage', 'opts', 'sit', @@ -2488,6 +2489,15 @@ def nondestructive(testEntity: _T) -> _T: return testEntity +def destructive(testEntity: _T) -> _T: + """Tests decorated as destructive will get their own VM + + Can be used on test classes and individual test methods. + """ + setattr(testEntity, '_testlib__nondestructive', False) + return testEntity + + def no_retry_when_changed(testEntity: _T) -> _T: """Tests decorated with no_retry_when_changed will only run once if they've been changed diff --git a/test/verify/check-storage-anaconda b/test/verify/check-storage-anaconda index c5fb6f3413c..ba6fdc491d9 100755 --- a/test/verify/check-storage-anaconda +++ b/test/verify/check-storage-anaconda @@ -638,6 +638,32 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= self.dialog_wait_close() b.wait_text(self.card_row_col("Storage", 1, 3), "Unformatted data") + @testlib.skipImage("No Stratis", "debian-*", "ubuntu-*") + @testlib.skipImage("No Anaconda", "arch") + @testlib.destructive + def testNoOndemandPackages(self): + b = self.browser + m = self.machine + + disk = self.add_loopback_disk(name="loop10") + + m.execute("systemctl stop stratisd; dnf remove -y stratisd stratis") + + anaconda_config = { + "mount_point_prefix": "/sysroot", + "available_devices": [disk], + } + + self.login_and_go("/storage") + self.enterAnacondaMode(anaconda_config) + + dropdown_toggle = self.dropdown_toggle(self.card_header("Storage")) + raid_action = self.dropdown_action(self.card_header("Storage"), "Create MDRAID device") + stratis_action = self.dropdown_action(self.card_header("Storage"), "Create Stratis pool") + b.click(dropdown_toggle) + b.wait_visible(raid_action) + b.wait_not_present(stratis_action) + if __name__ == '__main__': testlib.test_main()