tests: lxd console code breaks when using lxd as snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Running the integration tests using the lxd backend fails when lxd is installed as a snap:
https:/
The failure is a result of the tests/cloud_
49 cfg = "lxc.console.
50 orig = self._pylxd_
51 if orig:
52 orig += "\n"
53 self._pylxd_
LXD logs: https:/
My lxd setup/config: https:/
The specific issue I believe is that LXD as a snap is confined and does not have access to /tmp (need to confirm this) hence the error message:
console.
Related branches
- Scott Moser: Pending requested
-
Diff: 722 lines (+396/-58)11 files modifiedcloudinit/cmd/status.py (+4/-1)
cloudinit/cmd/tests/test_status.py (+28/-7)
cloudinit/net/__init__.py (+46/-17)
cloudinit/net/tests/test_init.py (+91/-0)
cloudinit/sources/DataSourceEc2.py (+6/-0)
cloudinit/ssh_util.py (+1/-4)
debian/changelog (+11/-0)
tests/cloud_tests/collect.py (+3/-2)
tests/cloud_tests/platforms/lxd/instance.py (+106/-26)
tests/unittests/test_datasource/test_ec2.py (+58/-1)
tests/unittests/test_sshutil.py (+42/-0)
- Scott Moser: Pending requested
-
Diff: 722 lines (+396/-58)11 files modifiedcloudinit/cmd/status.py (+4/-1)
cloudinit/cmd/tests/test_status.py (+28/-7)
cloudinit/net/__init__.py (+46/-17)
cloudinit/net/tests/test_init.py (+91/-0)
cloudinit/sources/DataSourceEc2.py (+6/-0)
cloudinit/ssh_util.py (+1/-4)
debian/changelog (+11/-0)
tests/cloud_tests/collect.py (+3/-2)
tests/cloud_tests/platforms/lxd/instance.py (+106/-26)
tests/unittests/test_datasource/test_ec2.py (+58/-1)
tests/unittests/test_sshutil.py (+42/-0)
- Joshua Powers (community): Approve
- Server Team CI bot: Approve (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 200 lines (+109/-28)2 files modifiedtests/cloud_tests/collect.py (+3/-2)
tests/cloud_tests/platforms/lxd/instance.py (+106/-26)
description: | updated |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
I talked with stgraber. snap/lxd/ common/ consoles (chmod 1777) or snap/lxd/ common/ lxd/logs/ CONTAINER- NAME/console. log
We have a couple options:
a.) if installed from snap, use
some path down /var/snap/lxd as a console log path
/var/
/var/
b.) use console --show-log
this requires liblxc > 3.0.
We could put into place code that did 'a' when it needed to (util.which( 'lxc'). startswith( '/snap' )) and used 'b' if it could.