Skip to content

Commit

Permalink
Merge pull request containers#1016 from flouthoc/fix-domainname-test
Browse files Browse the repository at this point in the history
test: ack `(none)` as output of `getdomainname`
  • Loading branch information
giuseppe committed Oct 2, 2022
2 parents 4934df9 + f94655c commit a73a1d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_domainname.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ def test_domainname():
conf = base_config()
conf['process']['args'] = ['/init', 'getdomainname']
add_all_namespaces(conf, utsns=False)
# getdomainname returns `(none)` if domainname is not set or will return error,
# in both of the above situation the test should pass. Anything other than this
# must be considered as failure.
try:
_, cid = run_and_get_output(conf)
out, cid = run_and_get_output(conf)
if out == "(none)\n":
return 0
sys.stderr.write("unexpected success\n")
return -1
except:
Expand Down

0 comments on commit a73a1d4

Please sign in to comment.