Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revive rhel-9.3 branch #19734

Merged
merged 30 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d523a49
test: Factorize cockpit-ws startup in TestClient
martinpitt Sep 28, 2023
2904ed6
test: Use standard logout test API in check-client
martinpitt Sep 28, 2023
e68c736
test: Accept destroyed execution context when clicking logout
martinpitt Sep 28, 2023
3f35d12
test: Cleanup volume group in one non-destructive test
mvollmer Sep 28, 2023
08d0c44
test: Relax boot timer check in TestServices.testTimerSession
martinpitt Oct 24, 2023
3385f87
test: Retry after UDisks2 timeout in TestStorageUsed.testUsed
mvollmer Nov 6, 2023
ce3b5ab
test: Fix wait timeout adjustment in TestIPA.testClientCertAuthentica…
martinpitt Nov 8, 2023
d4fd789
test: wait for journal to rotate in testLogs
jelly Nov 8, 2023
458ea56
test: Close modal in TestSystemInfo.testCryptoPolicies
martinpitt Nov 9, 2023
c58e2fc
test: Kill processes that keep scsi_debug mounts busy
martinpitt Nov 14, 2023
4b1aa2a
tests: increase timeout on testCPUSecurityMitigationsEnable
tomasmatus Nov 15, 2023
3ddec5f
test: Allow samba user creation to take some time
martinpitt Nov 14, 2023
0d00566
test: Replace ldapmodify with samba-tool user edit
martinpitt Nov 15, 2023
002489a
test: Adjust TestGrafanaClient to Grafana 10.2
martinpitt Nov 15, 2023
57d050b
test: Robustify waiting for candlepin
martinpitt Nov 15, 2023
735ce1d
test: Increase timeout for contacting AD domain
martinpitt Nov 15, 2023
775e363
test: Fix waiting for IdM user
martinpitt Nov 15, 2023
5d6e0b0
test: use become_superuser helper for switching access
jelly Nov 9, 2023
6056a19
test: Drop obsolete RHEL 8.7 special case
martinpitt Nov 15, 2023
6aca4be
test: Factorize and fix timeout for contacting domain
martinpitt Nov 16, 2023
1828ba4
test: Avoid sssd.service restart limit failure in check-system-realms
martinpitt Nov 16, 2023
b9005d8
test: Increaese IPA leave timeout
martinpitt Nov 16, 2023
4ee88ad
test: Drop sssd fiddling in testClientCertAuthentication
martinpitt Nov 17, 2023
d4a29ae
test: Drop obsolete INSECURELDAP hack
martinpitt Nov 17, 2023
b342c7b
test: Drop obsolete sssd hack
martinpitt Nov 17, 2023
2f13d9e
test: Retry auth in checkClientCertAuthentication
mvollmer Dec 8, 2023
38094ba
test: Use proper TLS CA for subscription-manager
martinpitt Nov 27, 2023
e53e28f
test: Adjust hack in TestGrafanaClient for non-crashing page (#19667)
martinpitt Nov 29, 2023
27ef800
test: Drop plugin update check crash hack
martinpitt Nov 29, 2023
c17189f
test: Disable busy swap on scsi_debug
martinpitt Dec 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,12 @@ def logout(self):
self.click('#go-logout')
else:
self.open_session_menu()
self.click('#logout')
try:
self.click('#logout')
except RuntimeError as e:
# logging out does destroy the current frame context, it races with the CDP driver finishing the command
if "Execution context was destroyed" not in str(e):
raise
self.wait_visible('#login')

self.machine.allow_restart_journal_messages()
Expand Down Expand Up @@ -1530,10 +1535,13 @@ def cleanup_home_dirs():
"for dev in $(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block); do "
" for s in /sys/block/*/slaves/${dev}*; do [ -e $s ] || break; "
" d=/dev/$(dirname $(dirname ${s#/sys/block/})); "
" while fuser --mount $d --kill; do sleep 0.1; done; "
" umount $d || true; dmsetup remove --force $d || true; "
" done; "
" umount /dev/$dev 2>/dev/null || true; "
"done; until rmmod scsi_debug; do sleep 0.2; done")
" while fuser --mount /dev/$dev --kill; do sleep 0.1; done; "
" umount /dev/$dev || true; "
" swapon --show=NAME --noheadings | grep $dev | xargs -r swapoff; "
"done; until rmmod scsi_debug; do sleep 0.2; done", stdout=None)

def terminate_sessions():
# on OSTree we don't get "web console" sessions with the cockpit/ws container; just SSH; but also, some tests start
Expand Down
9 changes: 3 additions & 6 deletions test/verify/check-client
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ Command = {self.libexecdir}/cockpit-beiboot
def logout(self, check_last_host=None):
b = self.browser

b.assert_no_oops()
b.open_session_menu()
b.click('#logout')
b.logout()
# FIXME: This is broken, nothing appears
# b.wait_text("#brand", "Connect to:")
if check_last_host:
Expand All @@ -83,17 +81,16 @@ Command = {self.libexecdir}/cockpit-beiboot
timeout=30)

def testBeibootNoBridge(self):
self.m_client.spawn(f"runuser -u admin -- {self.libexecdir}/cockpit-ws --no-tls", "ws.log")
# set up target machine: no cockpit
self.m_target.execute("rm /usr/bin/cockpit-bridge; rm -r /usr/share/cockpit")

self.checkLoginScenarios(local_bridge=False)

def testBeibootWithBridge(self):
self.m_client.spawn(f"runuser -u admin -- {self.libexecdir}/cockpit-ws --no-tls", "ws.log")
self.checkLoginScenarios(local_bridge=True)

def checkLoginScenarios(self, *, local_bridge=True):
self.m_client.spawn(f"runuser -u admin -- {self.libexecdir}/cockpit-ws --no-tls", "ws.log")

b = self.browser
b.open("/")

Expand Down
11 changes: 1 addition & 10 deletions test/verify/check-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -1486,15 +1486,6 @@ class TestGrafanaClient(testlib.MachineCase):
bg.click("button:contains('Log in')")
bg.wait_in_text("body", "Add your first data source")

# HACK Unsigned plugin needs to be enabled manually
# See https://github.com/performancecopilot/grafana-pcp/issues/94
bg.open("/plugins/performancecopilot-pcp-app")
with bg.wait_timeout(30):
bg.wait_visible(".gf-form-button-row button")
if bg.text(".gf-form-button-row button") == "Enable":
bg.click(".gf-form-button-row button")
bg.wait_text(".gf-form-button-row button", "Disable")

# Add the PCP redis data source for our client machine
# Cog (Configuration) menu → Data Sources → Add
# Select PCP redis, HTTP URL http://10.111.112.1:44322
Expand Down Expand Up @@ -1523,7 +1514,7 @@ class TestGrafanaClient(testlib.MachineCase):
# .. and the dashboard name becomes clickable
bg.click("a:contains('PCP Redis: Host Overview')")

bg.wait_in_text(".submenu-controls", "grafana-client")
bg.wait_in_text("#var-host", "grafana-client")

# expect a "Load average" panel with a sensible number
max_load = bg.text("div:contains('Load average') .graph-legend-series:contains('1 minute') .max")
Expand Down
22 changes: 8 additions & 14 deletions test/verify/check-packagekit
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ import time
import packagelib
import testlib

WAIT_SCRIPT = """
for x in $(seq 1 200); do
if curl --insecure -s https://%(addr)s:8443/candlepin; then
break
else
sleep 1
fi
done
"""

OSesWithoutTracer = ["debian-stable", "debian-testing", "ubuntu-2204", "ubuntu-stable", "fedora-coreos", "rhel4edge"]
OSesWithoutKpatch = ["debian-*", "ubuntu-*", "arch", "fedora-*", "rhel4edge", "centos-*"]

Expand Down Expand Up @@ -1275,7 +1265,7 @@ class TestUpdatesSubscriptions(packagelib.PackageCase):
def register(self):
# this fails with "Unable to find available subscriptions for all your installed products", but works anyway
self.machine.execute(
"LC_ALL=C.UTF-8 subscription-manager register --insecure --serverurl https://10.111.112.100:8443/candlepin --org=admin --activationkey=awesome_os_pool || true")
"LC_ALL=C.UTF-8 subscription-manager register --serverurl https://services.cockpit.lan:8443/candlepin --org=admin --activationkey=awesome_os_pool || true")
self.machine.execute("LC_ALL=C.UTF-8 subscription-manager attach --auto")

def setUp(self):
Expand All @@ -1297,11 +1287,15 @@ class TestUpdatesSubscriptions(packagelib.PackageCase):
m.execute("mkdir -p /etc/pki/product")
m.upload([product_file], "/etc/pki/product")

# make sure that rhsm skips certificate checks for the server
self.sed_file("s/insecure = 0/insecure = 1/g", "/etc/rhsm/rhsm.conf")
# set up CA
ca = self.candlepin.execute("cat /home/admin/candlepin/certs/candlepin-ca.crt")
m.write("/etc/pki/ca-trust/source/anchors/candlepin-ca.crt", ca)
m.write("/etc/hosts", "10.111.112.100 services.cockpit.lan\n", append=True)
m.execute("cp /etc/pki/ca-trust/source/anchors/candlepin-ca.crt /etc/rhsm/ca/candlepin-ca.pem")
m.execute("update-ca-trust")

# Wait for the web service to be accessible
m.execute(WAIT_SCRIPT % {"addr": "10.111.112.100"}, timeout=360)
m.execute("until curl --fail --silent --show-error https://services.cockpit.lan:8443/candlepin/status; do sleep 1; done")
self.update_icon = "#page_status_notification_updates svg"
self.update_text = "#page_status_notification_updates"
self.update_text_action = "#page_status_notification_updates a"
Expand Down
5 changes: 5 additions & 0 deletions test/verify/check-storage-mounting
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ class TestStorageMountingLUKS(storagelib.StorageCase):

self.login_and_go("/storage")

self.addCleanup(m.execute,
"umount /run/data || true;"
"cryptsetup close $(lsblk -lno NAME /dev/test/one | tail -1) || true;"
"vgremove --force test 2>/dev/null || true")

# Quickly make two logical volumes
disk = self.add_ram_disk()
b.wait_in_text("#drives", disk)
Expand Down
16 changes: 15 additions & 1 deletion test/verify/check-storage-used
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,21 @@ ExecStart=/usr/bin/sleep infinity
b.wait_visible("#dialog tr:first-child button:contains(Currently in use)")
b.assert_pixels('#dialog', "format-disk")
self.dialog_apply()
self.dialog_wait_close()
try:
self.dialog_wait_close()
except testlib.Error:
if "Timed out waiting for object" in b.text("#dialog"):
# Sometimes /dev/sda1 is still held open by something
# immediately after locking it. This prevents the
# kernel from reading the new partition table. Let's
# just try again.
print("WARNING: Retrying partition table creation")
self.dialog_cancel()
self.dialog_wait_close()
b.click('button:contains(Create partition table)')
self.confirm()
else:
raise

m.execute("! systemctl --quiet is-active keep-mnt-busy")

Expand Down
3 changes: 3 additions & 0 deletions test/verify/check-system-info
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ machine : 8561
spoof_threads(2, expect_link_present=True, expect_smt_state=self.expect_smt_default, cmdline=None)

@testlib.skipImage("TODO: add Arch Linux grub entry support", "arch")
@testlib.timeout(1200)
def testCPUSecurityMitigationsEnable(self):
b = self.browser
m = self.machine
Expand Down Expand Up @@ -1041,6 +1042,8 @@ password=foobar
b.click("#crypto-policy-button")
func = b.wait_not_present if m.image.startswith('rhel-8') or m.image.startswith('centos-8') else b.wait_visible
func(".pf-v5-c-menu__item-main .pf-v5-c-menu__item-text:contains('DEFAULT:SHA1')")
b.click("#crypto-policy-dialog button:contains('Cancel')")
b.wait_not_present("#crypto-policy-dialog")

# Test if a new subpolicy can be set
new_profile = "LEGACY:AD-SUPPORT"
Expand Down
Loading