Skip to content

Commit

Permalink
test: Amplify/debug TestFirewall.testNetworkingPage
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Sep 19, 2023
1 parent dd6e5ee commit 6d19681
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 113 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/unit-tests.yml

This file was deleted.

44 changes: 0 additions & 44 deletions packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,6 @@ srpm_build_deps:
# use the nicely formatted release NEWS from our upstream release, instead of git shortlog
copy_upstream_release_description: true
jobs:
- job: tests
identifier: self
trigger: pull_request
targets:
- fedora-38
- fedora-39
- fedora-latest-aarch64
- fedora-development
- centos-stream-8-x86_64
- centos-stream-9-x86_64
- centos-stream-9-aarch64

# current Fedora runs reverse dependency testing against https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/
- job: tests
identifier: revdeps
trigger: pull_request
targets:
- fedora-latest-stable
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo
tmt:
context:
revdeps: "yes"

# run build/unit tests on some interesting architectures
- job: copr_build
trigger: pull_request
targets:
# 32 bit
- fedora-development-i386
# big-endian
- fedora-development-s390x

# for cross-project testing
- job: copr_build
trigger: commit
branch: "^main$"
owner: "@cockpit"
project: "main-builds"
preserve_project: True

- job: copr_build
trigger: release
owner: "@cockpit"
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkmanager/firewall-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ const firewalld_service = service.proxy('firewalld');
let firewalld_dbus = null;

function debug() {
if (window.debugging == "all" || window.debugging?.includes("firewalld")) // not-covered: debugging
console.debug("firewalld:", ...arguments); // not-covered: debugging
console.debug("firewalld:", ...arguments); // not-covered: debugging
}

firewall.debouncedGetZones = debounce(300, () => {
Expand Down
38 changes: 22 additions & 16 deletions test/verify/check-networkmanager-firewall
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ class TestFirewall(netlib.NetworkCase):
wait_unit_state(m, "firewalld", "inactive")
b.wait_in_text("#networking-firewall-summary", "0 active zones")

b.cdp.trace = True
m.verbose = True

# toggle the service from CLI, page should react
try:
m.execute("systemctl start firewalld")
Expand All @@ -109,27 +112,30 @@ class TestFirewall(netlib.NetworkCase):
m.execute("firewall-cmd --get-active-zones >&2")
raise

try:
m.execute("systemctl stop firewalld")
wait_unit_state(m, "firewalld", "inactive")
except testlib.Error:
print("====== firewalld.service =======")
print(m.execute("systemctl status firewalld"))
raise
self.allow_journal_messages(
".*The name org.fedoraproject.FirewallD1 was not provided by any .service files.*",
".*org.fedoraproject.FirewallD1: .*: GDBus.Error:org.freedesktop.DBus.Error.NoReply.*")

self.wait_onoff("#networking-firewall-summary", val=False)
b.wait_in_text("#networking-firewall-summary", "0 active zones")
def testNetworkingPage2(self):
self.testNetworkingPage()

b.click("#networking-firewall-link")
b.enter_page("/network/firewall")
def testNetworkingPage3(self):
self.testNetworkingPage()

b.click(".pf-v5-c-breadcrumb li:first-of-type")
def testNetworkingPage4(self):
self.testNetworkingPage()

b.enter_page("/network")
def testNetworkingPage5(self):
self.testNetworkingPage()

self.allow_journal_messages(
".*The name org.fedoraproject.FirewallD1 was not provided by any .service files.*",
".*org.fedoraproject.FirewallD1: .*: GDBus.Error:org.freedesktop.DBus.Error.NoReply.*")
def testNetworkingPage6(self):
self.testNetworkingPage()

def testNetworkingPage7(self):
self.testNetworkingPage()

def testNetworkingPage8(self):
self.testNetworkingPage()

# test missing "pkcheck" binary, in that case fallback to the admin check
def testPkcheckMissing(self):
Expand Down

0 comments on commit 6d19681

Please sign in to comment.