test: Fix host name lookup (#473)

Our code reads /etc/hostname. Do the same in the test, as the runtime
sethostname(2) (set by hostnamed) and static host name may be different.
This commit is contained in:
Martin Pitt 2021-07-06 09:02:39 +02:00 committed by GitHub
parent 37b2ee5056
commit cfaa74f761
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ class TestApplication(testlib.MachineCase):
b.wait_text(".pf-c-card__title", "Starter Kit")
# verify expected host name
hostname = m.execute("hostname").strip()
hostname = m.execute("cat /etc/hostname").strip()
b.wait_in_text(".pf-c-alert__title", "Running on " + hostname)
# change current hostname