issues using user and password in adt-virt-qemu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autopkgtest (Ubuntu) |
Fix Released
|
Medium
|
Martin Pitt |
Bug Description
I found a few issues I wanted to report that I ran into trying to avoid another issue by using using --user/--password.
First I found that with debug enabled this fails:
File "/home/
VirtSubproc
File "/home/
adtlog.
AttributeError: 'NoneType' object has no attribute 'decode'
This would be fixed by:
--- /home/ubuntu/
+++ /home/ubuntu/
@@ -230,7 +230,8 @@
def expect(sock, search_bytes, timeout_sec, description=None, echo=False):
- adtlog.
+ if search_bytes:
+ adtlog.
what = '"%s"' % (description or search_bytes or 'data')
out = b''
with timeout(
Then second there is a non conform concat when setting up the shell for that:
File "/home/
cmd = b"sudo sh -c '" + cmd + "'"
TypeError: can't concat bytes to str
Fixed by:
--- virt/autopkgtes
+++ virt/autopkgtes
@@ -178,7 +178,7 @@
# if we are a non-root user, run through sudo
if args.user != 'root':
- cmd = b"sudo sh -c '" + cmd + "'"
+ cmd = b"sudo sh -c '" + cmd + b"'"
term.send(cmd)
term.
Fixed in https:/ /anonscm. debian. org/cgit/ autopkgtest/ autopkgtest. git/commit/ ?id=24bacc0, thanks!
Note that this will still not work if sudo needs a password, only for passwordless sudo (like in cloud instances). But I'm going to teach a-v-qemu about that now.