Skip to content

Commit

Permalink
test: Cleanup rhel-8-1 special cases
Browse files Browse the repository at this point in the history
  • Loading branch information
marusak authored and martinpitt committed Jan 25, 2020
1 parent 33f7dcf commit 48e2bb1
Show file tree
Hide file tree
Showing 37 changed files with 254 additions and 638 deletions.
2 changes: 0 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ You can set these environment variables to configure the test suite:
"fedora-testing"
"rhel-7-7"
"rhel-7-8"
"rhel-8-1"
"rhel-8-1-distropkg"
"rhel-8-2"
"rhel-8-2-distropkg"
"rhel-atomic"
Expand Down
2 changes: 1 addition & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ def check_journal_messages(self, machine=None):
# Fedora >= 30 switched to dbus-broker
self.allowed_messages.append("dbus-daemon didn't send us a dbus address; not installed?.*")

if self.image in ['rhel-8-1', 'rhel-8-1-distropkg', 'rhel-8-2', 'rhel-8-2-distropkg']:
if self.image in ['rhel-8-2', 'rhel-8-2-distropkg']:
# HACK: https://bugzilla.redhat.com/show_bug.cgi?id=1753991
self.allowed_messages.append('.*type=1400.*avc: denied { dac_override } .* comm="rhsmd" .* scontext=system_u:system_r:rhsmcertd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:rhsmcertd_t:.*')

Expand Down
30 changes: 8 additions & 22 deletions test/verify/check-accounts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,8 @@ class TestAccounts(MachineCase):
b.go("#/root")
b.wait_text("#account-user-name", "root")
# some operations are not allowed for root user
if m.image in ["rhel-8-1-distropkg"]:
b.wait_present("#account-delete.disabled")
b.wait_present("#account-real-name-wrapper.disabled")
else:
b.wait_present("#account-delete[disabled]")
b.wait_present("#account-real-name-wrapper[disabled]")
b.wait_present("#account-delete[disabled]")
b.wait_present("#account-real-name-wrapper[disabled]")
b.wait_attr("#account-logout", "disabled", "disabled")
b.wait_present("#account-locked:not(:checked)")
# root account should not be locked by default on our images
Expand Down Expand Up @@ -116,9 +112,8 @@ class TestAccounts(MachineCase):
self.assertEqual(m.execute("stat -c '%U' {0}".format(home_dir)).strip(), "berta")

# Check that we set up shell configured in /etc/default/useradd
if m.image != "rhel-8-1-distropkg": # Added in #13329
shell = m.execute("getent passwd berta | cut -f7 -d:").strip()
self.assertEqual(shell, '/bin/true')
shell = m.execute("getent passwd berta | cut -f7 -d:").strip()
self.assertEqual(shell, '/bin/true')

# Delete it externally
m.execute("userdel berta")
Expand Down Expand Up @@ -161,10 +156,7 @@ class TestAccounts(MachineCase):
b.set_checked(admin_role_sel, True)
b.wait(is_admin)
# An alert which shows up once we've changed thinrgs
if m.image == "rhel-8-1-distropkg":
b.wait_present("#account-roles .alert-info")
else:
b.wait_present("#account-roles .pf-c-alert.pf-m-info")
b.wait_present("#account-roles .pf-c-alert.pf-m-info")
b.wait_present(admin_role_sel + ":checked")
b.set_checked(admin_role_sel, False)
b.wait(lambda: not is_admin())
Expand Down Expand Up @@ -208,7 +200,7 @@ class TestAccounts(MachineCase):
b.wait_present('#content')

# incomplete passwd entry; fixed in PR #13384
if m.image not in ["rhel-8-1-distropkg", "rhel-8-2-distropkg"]:
if m.image not in ["rhel-8-2-distropkg"]:
m.execute('echo "damaged:x:1234:1234:Damaged" >> /etc/passwd')
b.go("/users")
b.enter_page("/users")
Expand Down Expand Up @@ -394,15 +386,9 @@ class TestAccounts(MachineCase):
b.go("#/scruffy")
b.wait_text("#account-user-name", "scruffy")
b.wait_text("#account-expiration-button", "Never lock account")
if m.image in ["rhel-8-1-distropkg"]:
b.wait_present("#account-expiration-button.disabled")
else:
b.wait_present("#account-expiration-button[disabled]")
b.wait_present("#account-expiration-button[disabled]")
b.wait_in_text("#password-expiration-button", "Require password change on")
if m.image in ["rhel-8-1-distropkg"]:
b.wait_present("#password-expiration-button.disabled")
else:
b.wait_present("#password-expiration-button[disabled]")
b.wait_present("#password-expiration-button[disabled]")

# Lastly force a password change
b.logout()
Expand Down
9 changes: 2 additions & 7 deletions test/verify/check-active-pages
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@ class TestActivePages(MachineCase):
self.login_and_go("/system")

# Preloading via manifests only happens with #12534
if m.image in [ "rhel-8-1-distropkg" ]:
n_extra_preloaded = 0
elif m.ostree_image:
if m.ostree_image:
# /playground/preloaded and /system/services
n_extra_preloaded = 2
else:
# /playground/preloaded, /system/services, and /updates
n_extra_preloaded = 3

if m.image in [ "rhel-8-1-distropkg" ]:
b.wait_present("#server")
else:
b.wait_present("#overview")
b.wait_present("#overview")

def showPagesAssertCount(count):
b.switch_to_top()
Expand Down
27 changes: 7 additions & 20 deletions test/verify/check-connection
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class TestConnection(MachineCase):
self.allow_journal_messages(".*org.freedesktop.hostname1.*DBus.Error.NoReply.*")

@skipImage("OSTree doesn't use systemd units", "fedora-coreos")
@skipImage("Introduced in PR #12902", "rhel-8-1-distropkg")
def testUnitLifecycle(self):
m = self.machine

Expand Down Expand Up @@ -247,7 +246,6 @@ class TestConnection(MachineCase):
self.assertIn("Permission denied", out)

@skipImage("OSTree doesn't use systemd units", "fedora-coreos")
@skipImage("Introduced in PR #12972", "rhel-8-1-distropkg")
def testHttpsInstanceDoS(self):
m = self.machine
# prevent generating core dump artifacts
Expand Down Expand Up @@ -333,12 +331,12 @@ class TestConnection(MachineCase):
check_cert_chain()

# *.crt file also works; added in PR #13388
if m.image not in ["rhel-8-1-distropkg", "rhel-8-2-distropkg"]:
if m.image not in ["rhel-8-2-distropkg"]:
m.execute ("mv /etc/cockpit/ws-certs.d/cert-chain.cert /etc/cockpit/ws-certs.d/cert-chain.crt")
check_cert_chain()

# separate *.key file instead of merged .cert; added in PR #13388
if m.image not in ["rhel-8-1-distropkg", "rhel-8-2-distropkg"]:
if m.image not in ["rhel-8-2-distropkg"]:
m.execute("sed -n '/---BEGIN PRIVATE KEY/,$ p' /etc/cockpit/ws-certs.d/cert-chain.crt > /etc/cockpit/ws-certs.d/cert-chain.key")
m.execute("sed -i '/---BEGIN PRIVATE KEY/,$ d' /etc/cockpit/ws-certs.d/cert-chain.crt")
check_cert_chain()
Expand Down Expand Up @@ -467,16 +465,15 @@ class TestConnection(MachineCase):
self.assertIn('A Custom Title', m.execute('''curl -s -S -H "Authorization: Negotiate $(printf '%0.7000i' 1)" http://localhost:9000/'''))

# Large requests are processed correctly with TLS
if m.image not in ["rhel-8-1-distropkg", "rhel-8-2-distropkg"]: # fixed in PR #13351
if m.image not in ["rhel-8-2-distropkg"]: # fixed in PR #13351
self.assertIn('A Custom Title', m.execute('''curl -s -S -k -H "Authorization: Negotiate $(printf '%0.7000i' 1)" https://localhost:9000/'''))

# Large requests are processed correctly with plain HTTP through cockpit-tls
m.start_cockpit(tls=True)
self.assertIn('id="login"', m.execute('''curl -s -S -H "Authorization: Negotiate $(printf '%0.7000i' 1)" http://localhost:9090/'''))

# Large requests are processed correctly with TLS through cockpit-tls
if m.image not in ["rhel-8-1-distropkg"]: # fixed in PR #13351, and 8.1 is not using cockpit-tls yet
self.assertIn('id="login"', m.execute('''curl -s -S -k -H "Authorization: Negotiate $(printf '%0.7000i' 1)" https://localhost:9090/'''))
self.assertIn('id="login"', m.execute('''curl -s -S -k -H "Authorization: Negotiate $(printf '%0.7000i' 1)" https://localhost:9090/'''))

def testHeadRequest(self):
m = self.machine
Expand Down Expand Up @@ -549,11 +546,7 @@ class TestConnection(MachineCase):
m.wait_for_cockpit_running('127.0.0.90', 9999)
# System frame should work directly, no login page
out = m.execute("curl --compressed http://127.0.0.90:9999/cockpit/@localhost/system/index.html")
if m.image == "rhel-8-1-distropkg":
self.assertIn('id="system_machine_id"', out)
self.assertIn('data-action="shutdown"', out)
else:
self.assertIn('id="overview"', out)
self.assertIn('id="overview"', out)

# shut it down, wait until it is gone
m.execute("pkill -ef cockpit-ws")
Expand All @@ -570,11 +563,7 @@ G_MESSAGES_DEBUG=all XDG_CONFIG_DIRS=/usr/local %s -p 9999 -a 127.0.0.90 --local

# System frame should work directly, no login page
out = m.execute("curl --compressed http://127.0.0.90:9999/cockpit/@localhost/system/index.html")
if m.image == "rhel-8-1-distropkg":
self.assertIn('id="system_machine_id"', out)
self.assertIn('data-action="shutdown"', out)
else:
self.assertIn('id="overview"', out)
self.assertIn('id="overview"', out)

self.allow_journal_messages("couldn't register polkit authentication agent.*")

Expand All @@ -584,7 +573,7 @@ G_MESSAGES_DEBUG=all XDG_CONFIG_DIRS=/usr/local %s -p 9999 -a 127.0.0.90 --local
m = self.machine

cases = [(['/cockpit/@localhost/system/index.html', 'system', 'system/index', 'system/'],
['id="system_machine_id"' if m.image == "rhel-8-1-distropkg" else 'id="overview"']
['id="overview"']
),
(['/cockpit/@localhost/network/firewall.html', 'network/firewall'],
['div id="firewall"', 'script src="firewall.js"']
Expand Down Expand Up @@ -614,7 +603,6 @@ G_MESSAGES_DEBUG=all XDG_CONFIG_DIRS=/usr/local %s -p 9999 -a 127.0.0.90 --local
self.allow_journal_messages("couldn't register polkit authentication agent.*")

@skipImage("does not use cockpit-ws package", "fedora-coreos")
@skipImage("Added in PR #11813 and #12141", "rhel-8-1-distropkg")
@skipBrowser("Firefox needs proper cert and CA", "firefox")
def testReverseProxy(self):
m = self.machine
Expand Down Expand Up @@ -709,7 +697,6 @@ G_MESSAGES_DEBUG=all XDG_CONFIG_DIRS=/usr/local %s -p 9999 -a 127.0.0.90 --local
self.assertIn("HTTP/1.1 301 Moved Permanently", m.execute("curl --silent --head http://172.27.0.15:9091"))
self.assertIn("HTTP/1.1 200 OK", m.execute("curl --silent --head http://127.0.0.1:9091"))

@skipImage("Implemented in #12493", "rhel-8-1-distropkg")
def testCaCert(self):
m = self.machine

Expand Down
5 changes: 2 additions & 3 deletions test/verify/check-dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ class TestBasicDashboard(MachineCase, DashBoardHelpers):

b.enter_page("/system", "10.111.113.3")
b.wait_text_not("#system_information_systime_button", "")
if m.image not in ["rhel-8-1-distropkg"]:
b.click(".system-usage a") # View graphs
b.enter_page("/system/graphs", "10.111.113.3")
b.click(".system-usage a") # View graphs
b.enter_page("/system/graphs", "10.111.113.3")
b.click("#link-network a")
b.enter_page("/network", "10.111.113.3")

Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-docker
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ from testlib import *


@skipPackage("cockpit-docker")
@skipImage("No docker packaged", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
@skipImage("No docker packaged", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
@skipImage("Not supporting cockpit-docker on CoreOS", "fedora-coreos")
@skipImage("Docker not available", "fedora-31") # https://github.com/cockpit-project/cockpit/issues/12670
class TestDocker(MachineCase):
Expand Down Expand Up @@ -548,7 +548,7 @@ CMD ["/bin/sh"]

@skipImage("No cockpit-docker on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg")
"ubuntu-1804", "rhel-8-2", "rhel-8-2-distropkg")
def testContainerProblems(self):
b = self.browser
m = self.machine
Expand Down Expand Up @@ -590,7 +590,7 @@ CMD ["/bin/sh"]
@skipImage("Skip on systems without atomic and ones with missing deps", "debian-stable",
"debian-testing", "ubuntu-1804", "ubuntu-stable", "fedora-coreos", "fedora-i386",
"fedora-31")
@skipImage("No docker packaged", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
@skipImage("No docker packaged", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
@skipPackage("cockpit-docker")
class TestAtomicScan(MachineCase):

Expand Down
4 changes: 2 additions & 2 deletions test/verify/check-docker-storage
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def can_manage(machine):


@skipImage("No cockpit-docker on i386", "fedora-i386")
@skipImage("No docker packaged", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "fedora-coreos", "centos-8-stream")
@skipImage("No docker packaged", "rhel-8-2", "rhel-8-2-distropkg", "fedora-coreos", "centos-8-stream")
@skipImage("Docker not available", "fedora-31") # https://github.com/cockpit-project/cockpit/issues/12670
@skipPackage("cockpit-docker")
class TestDockerStorageDirect(MachineCase):
Expand All @@ -54,7 +54,7 @@ class TestDockerStorageDirect(MachineCase):


@skipImage("No cockpit-docker on i386", "fedora-i386")
@skipImage("No docker packaged", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "fedora-coreos", "centos-8-stream")
@skipImage("No docker packaged", "rhel-8-2", "rhel-8-2-distropkg", "fedora-coreos", "centos-8-stream")
@skipImage("Docker not available", "fedora-31") # https://github.com/cockpit-project/cockpit/issues/12670
@skipPackage("cockpit-docker")
class TestDockerStorage(MachineCase):
Expand Down
22 changes: 7 additions & 15 deletions test/verify/check-journal
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1
})""", expected)

def wait_journal_empty():
# Changed in #13039
if m.image == "rhel-8-1-distropkg":
wait_log_lines([])
else:
wait_log_lines(["No Logs FoundCan not find any logs using the current combination of filters."])
wait_log_lines(["No Logs FoundCan not find any logs using the current combination of filters."])

b.go("#/?prio=*&service=log123.service")
wait_journal_empty()
Expand Down Expand Up @@ -284,11 +280,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1
"Load earlier entries",
])

# Changed in #13039
if m.image == "rhel-8-1-distropkg":
b.click('#journal-load-earlier')
else:
b.click('#start-box button:contains("Load earlier entries")')
b.click('#start-box button:contains("Load earlier entries")')

wait_log_lines([expected_date,
["check-journal", "AFTER BOOT", ""],
Expand Down Expand Up @@ -383,7 +375,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1

@skipImage("ABRT does not work on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "fedora-coreos", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
"ubuntu-1804", "fedora-coreos", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
def testAbrtSegv(self):
self.allow_core_dumps = True
b = self.browser
Expand Down Expand Up @@ -422,7 +414,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1

@skipImage("ABRT does not work on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "fedora-coreos", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
"ubuntu-1804", "fedora-coreos", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
def testAbrtDelete(self):
self.allow_core_dumps = True
b = self.browser
Expand Down Expand Up @@ -456,7 +448,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1

@skipImage("ABRT does not work on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "fedora-coreos", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
"ubuntu-1804", "fedora-coreos", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
def testAbrtReport(self):
self.allow_core_dumps = True
# The testing server is located at verify/files/mock-faf-server.py
Expand Down Expand Up @@ -531,7 +523,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1

@skipImage("ABRT does not work on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "fedora-coreos", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
"ubuntu-1804", "fedora-coreos", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
def testAbrtReportCancel(self):
self.allow_core_dumps = True

Expand Down Expand Up @@ -571,7 +563,7 @@ ExecStart=/bin/sh -c 'for s in $(seq 10); do echo SLOW; sleep 0.1; done; sleep 1

@skipImage("ABRT does not work on i386", "fedora-i386")
@skipImage("ABRT not available", "debian-stable", "debian-testing", "ubuntu-stable",
"ubuntu-1804", "fedora-coreos", "rhel-8-1", "rhel-8-1-distropkg", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
"ubuntu-1804", "fedora-coreos", "rhel-8-2", "rhel-8-2-distropkg", "centos-8-stream")
def testAbrtReportNoReportd(self):
self.allow_core_dumps = True

Expand Down
Loading

0 comments on commit 48e2bb1

Please sign in to comment.