ntp unit tests broken if no package program available in test environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Low
|
Unassigned |
Bug Description
apply this diff to show the error, just make 'ntp_installable' not
find a package installer. At minimum, we just need to mock that out.
$ git diff
diff --git a/cloudinit/
index 15ae1ecd..5ebdd461 100644
--- a/cloudinit/
+++ b/cloudinit/
@@ -147,6 +147,7 @@ def ntp_installable():
if util.system_
return False
+ return False
if any(map(util.which, ['apt-get', 'dnf', 'yum', 'zypper'])):
return True
$ tox-venv py3 python3 -m nose tests/unittests
...EEEEEE.
=======
ERROR: Test ntp handler renders the shipped distro ntp.conf templates.
-------
Traceback (most recent call last):
File "/home/
cc_
File "/home/
write_
File "/home/
"not rendering %s"), path)
RuntimeError: ('No template found, not rendering %s', '/etc/systemd/
=======
ERROR: Ntp schema validation allows for an empty ntp: configuration.
-------
Traceback (most recent call last):
File "/home/
with open(ntp_conf) as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ci-
=======
ERROR: Ntp schema validation warns of invalid keys present in ntp config.
-------
Traceback (most recent call last):
File "/home/
with open(ntp_conf) as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ci-
=======
ERROR: Ntp schema validation warns of non-strings in pools or servers.
-------
Traceback (most recent call last):
File "/home/
with open(ntp_conf) as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ci-
=======
ERROR: Ntp schema validation warns of duplicates in servers or pools.
-------
Traceback (most recent call last):
File "/home/
with open(ntp_conf) as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ci-
=======
ERROR: Ntp schema validation warns of non-array pools or servers types.
-------
Traceback (most recent call last):
File "/home/
with open(ntp_conf) as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ci-
-------
Ran 21 tests in 0.085s
FAILED (errors=6)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Tracked in Github Issues as https:/ /github. com/canonical/ cloud-init/ issues/ 3021