[Bug 1630963] Re: issues using user and password in adt-virt-qemu

Martin Pitt martin.pitt at ubuntu.com
Thu Oct 6 12:47:41 UTC 2016


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.

** Changed in: autopkgtest (Ubuntu)
   Importance: Undecided => Medium

** Changed in: autopkgtest (Ubuntu)
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to autopkgtest in Ubuntu.
https://bugs.launchpad.net/bugs/1630963

Title:
  issues using user and password in adt-virt-qemu

Status in autopkgtest package in Ubuntu:
  Fix Committed

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/ubuntu/autopkgtest-4.1/virt/autopkgtest-virt-qemu", line 171, in login_tty_and_setup_shell
      VirtSubproc.expect(term, None, 10, 'password prompt')
    File "/home/ubuntu/autopkgtest-4.1/lib/VirtSubproc.py", line 233, in expect
      adtlog.debug('expect: "%s"' % search_bytes.decode())
  AttributeError: 'NoneType' object has no attribute 'decode'

  This would be fixed by:
  --- /home/ubuntu/autopkgtest-4.1/lib/VirtSubproc.py.orig        2016-10-06 07:36:21.330764811 -0400
  +++ /home/ubuntu/autopkgtest-4.1/lib/VirtSubproc.py     2016-10-06 07:30:29.110383136 -0400
  @@ -230,7 +230,8 @@
   
   
   def expect(sock, search_bytes, timeout_sec, description=None, echo=False):
  -    adtlog.debug('expect: "%s"' % search_bytes.decode())
  +    if search_bytes:
  +        adtlog.debug('expect: "%s"' % search_bytes.decode())
       what = '"%s"' % (description or search_bytes or 'data')
       out = b''
       with timeout(timeout_sec,

  
  Then second there is a non conform concat when setting up the shell for that:
    File "/home/ubuntu/autopkgtest-4.1/virt/autopkgtest-virt-qemu", line 181, in login_tty_and_setup_shell
      cmd = b"sudo sh -c '" + cmd + "'"
  TypeError: can't concat bytes to str

  Fixed by:
  --- virt/autopkgtest-virt-qemu.orig     2016-10-06 07:13:55.409049291 -0400
  +++ virt/autopkgtest-virt-qemu  2016-10-06 07:33:19.730639581 -0400
  @@ -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.send(b'\nexit\n')

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autopkgtest/+bug/1630963/+subscriptions



More information about the foundations-bugs mailing list