Skip to content

Commit

Permalink
test: stop local worker socket
Browse files Browse the repository at this point in the history
Since osbuild-composer release 25 there is now an osbuild-local-worker
socket. This socket is also able to start the osbuild-composer service.
So, in the services test, the local worker socket is now stopped
alongside the osbuild-composer service and socket.
  • Loading branch information
jkozol committed Dec 9, 2020
1 parent ef1d04e commit da77319
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
21 changes: 15 additions & 6 deletions test/verify/check-service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# checkpoint:
# 1. osbuild-composer.socket can be started and enabled
# 2. no blueprint by default and can add and delete blueprint

import os
import string
import random

Expand All @@ -18,13 +18,18 @@ class TestService(composerlib.ComposerCase):
# remove all blueprints
# stop and disable osbuild-composer.socket service
super().setUp()
m = self.machine
distro = os.environ.get("TEST_OS")

self.machine.execute("""
m.execute("""
for bp in $(composer-cli blueprints list); do
composer-cli blueprints delete $bp
done
systemctl disable --now osbuild-composer.socket osbuild-composer.service
""")
if (distro == "fedora-32" or distro == "fedora-33"):
m.execute("systemctl disable --now osbuild-local-worker.socket")


def testBasic(self):
b = self.browser
Expand Down Expand Up @@ -110,9 +115,11 @@ class TestService(composerlib.ComposerCase):
def testNoEnable(self):
b = self.browser
m = self.machine

# stop and disable osbuild-composer.socket
distro = os.environ.get("TEST_OS")
# stop and disable the osbuild-composer service and sockets
m.execute("systemctl disable --now osbuild-composer.socket osbuild-composer.service")
if (distro == "fedora-32" or distro == "fedora-33"):
m.execute("systemctl disable --now osbuild-local-worker.socket")

self.login_and_go("/composer", superuser=True)
b.wait_present("#main")
Expand All @@ -137,9 +144,11 @@ class TestService(composerlib.ComposerCase):
def testNonAdminUser(self):
b = self.browser
m = self.machine

# stop and disable osbuild-composer.socket
distro = os.environ.get("TEST_OS")
# stop and disable the osbuild-composer service and sockets
m.execute("systemctl disable --now osbuild-composer.socket osbuild-composer.service")
if (distro == "fedora-32" or distro == "fedora-33"):
m.execute("systemctl disable --now osbuild-local-worker.socket")

self.login_and_go("/composer", superuser=False)
b.wait_present("#main")
Expand Down
8 changes: 7 additions & 1 deletion test/verify/composerlib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import hashlib
import os
import pathlib

import parent
Expand Down Expand Up @@ -27,6 +28,8 @@ class ComposerCase(testlib.MachineCase):
def setUp(self):
super().setUp(restrict=False)

distro = os.environ.get("TEST_OS")

self.allow_journal_messages(*allowed_journal_messages)
self.allow_browser_errors(*allowed_browser_errors)

Expand All @@ -35,9 +38,12 @@ def setUp(self):

# re-start osbuild-composer.socket
self.machine.execute(script="""#!/bin/sh
systemctl stop --quiet osbuild-composer.socket osbuild-composer.service
systemctl stop --quiet osbuild-composer.socket osbuild-local-worker.socket osbuild-composer.service
systemctl start osbuild-composer.socket
""")
if (distro == "fedora-32" or distro == "fedora-33"):
self.machine.execute("systemctl disable --now osbuild-local-worker.socket")


# push pre-defined blueprint
self.machine.execute(script="""#!/bin/sh
Expand Down

0 comments on commit da77319

Please sign in to comment.