From 019f61fda1cb6264f6e295a661f1794d31db7e14 Mon Sep 17 00:00:00 2001 From: Benjamin Graham Date: Wed, 27 May 2020 09:27:38 -0400 Subject: [PATCH] Bump cockpit test version from 199 to 219 Calls to `allow_authorize_journal_messages` are no longer needed --- .gitignore | 2 ++ Makefile | 9 ++++++--- test/check-application | 8 ++------ test/vm.install | 3 +++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 32b6401..927248a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ test/common/ test/images/ *.pot POTFILES* +tmp/ +.mypy_cache diff --git a/Makefile b/Makefile index b0346f9..61b2302 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec # build a VM with locally built rpm installed $(VM_IMAGE): rpm bots rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2 - bots/image-customize -v -i cockpit -i `pwd`/cockpit-$(PACKAGE_NAME)-*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS) + bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-$(PACKAGE_NAME)-*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS) bots/image-customize -v -r "usermod -u 981 tlog || true" $(TEST_OS) bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $(TEST_OS) @@ -136,12 +136,15 @@ check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common # checkout Cockpit's bots for standard test VM images and API to launch them # must be from master, as only that has current and existing images; but testvm.py API is stable bots: - [ -d bots ] || git clone --depth=1 https://github.com/cockpit-project/bots.git + sudo rm -rf bots + git clone --quiet --reference-if-able $${XDG_CACHE_HOME:-$$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git + if [ -n "$$COCKPIT_BOTS_REF" ]; then git -C bots fetch --quiet --depth=1 origin "$$COCKPIT_BOTS_REF"; git -C bots checkout --quiet FETCH_HEAD; fi + @echo "checked out bots/ ref $$(git -C bots rev-parse HEAD)" # checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag # when you start a new project, use the latest relese, and update it from time to time test/common: - git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 199 + git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 219 git checkout --force FETCH_HEAD -- test/common git reset test/common diff --git a/test/check-application b/test/check-application index d74a352..d1dfded 100755 --- a/test/check-application +++ b/test/check-application @@ -15,7 +15,6 @@ from testlib import * # Test with pre-recorded journal with tlog UID 981 class TestApplication(MachineCase): def testPlay(self): - self.allow_authorize_journal_messages() term_first_line = ".xterm-accessibility-tree div:nth-child(1)" b = self.browser m = self.machine @@ -28,7 +27,6 @@ class TestApplication(MachineCase): b.wait_in_text(term_first_line, "localhost") def testFastforwardControls(self): - self.allow_authorize_journal_messages() last_term_line = ".xterm-accessibility-tree > div:nth-child(26)" slider = ".slider > .min-slider-handle" b = self.browser @@ -46,7 +44,6 @@ class TestApplication(MachineCase): b.wait_attr(slider, "style", "left: 100%;") def testSpeedControls(self): - self.allow_authorize_journal_messages() speed_val = ".panel-footer > span:nth-child(10)" b = self.browser m = self.machine @@ -89,7 +86,6 @@ class TestApplication(MachineCase): b.wait_text(speed_val, "/2") def testZoomControls(self): - self.allow_authorize_journal_messages() default_scale_sel = '.console-ct[style^="transform: scale(1)"]' zoom_one_scale_sel = '.console-ct[style^="transform: scale(1.1)"]' zoom_two_scale_sel = '.console-ct[style^="transform: scale(1.2)"]' @@ -122,7 +118,6 @@ class TestApplication(MachineCase): b.wait_present(zoom_reset_scale_sel) def testSkipFrame(self): - self.allow_authorize_journal_messages() term_first_line = ".xterm-accessibility-tree div:nth-child(1)" b = self.browser m = self.machine @@ -138,5 +133,6 @@ class TestApplication(MachineCase): b.wait_timeout(20) b.wait_in_text(term_first_line, "localhost") -if __name__ == '__main__': + +if __name__ == "__main__": test_main() diff --git a/test/vm.install b/test/vm.install index 55e548d..5241745 100644 --- a/test/vm.install +++ b/test/vm.install @@ -10,3 +10,6 @@ if type firewall-cmd >/dev/null 2>&1; then firewall-cmd --add-service=cockpit --permanent fi systemctl enable cockpit.socket + +# HACK: See https://github.com/cockpit-project/cockpit/issues/14133 +mkdir -p /usr/share/cockpit/packagekit