<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9866</bug_id>
          
          <creation_ts>2016-07-01 19:22:20 +0000</creation_ts>
          <short_desc>Sanity tests fail due to permission problem</short_desc>
          <delta_ts>2016-07-29 14:49:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>AutoBuilder</product>
          <component>autobuilder</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bill Randle">bill.randle</reporter>
          <assigned_to name="Bill Randle">bill.randle</assigned_to>
          <cc>infras.ab.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>pidge</cc>
    
    <cc>sgw</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63593</commentid>
    <comment_count>0</comment_count>
    <who name="Bill Randle">bill.randle</who>
    <bug_when>2016-07-01 19:22:20 +0000</bug_when>
    <thetext>On the new yocto.io AB cluster, the sanity tests are failing, presumably because of a permissions problem (though it could be something else).

NOTE: recipe core-image-sato-sdk-1.0-r0: task do_testimage: Started
WARNING: core-image-minimal-1.0-r0 do_testimage: Qemu ended unexpectedly, dump data from host is in /tmp/oe-saved-tests/201607011710_qemu
ERROR: core-image-minimal-1.0-r0 do_testimage: Function failed: do_testimage
ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_testimage.2944
Log data follows:
| DEBUG: Executing python function do_testimage
| NOTE: rootfs file: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testimage/core-image-minimal-qemuarm-testimage.ext4
| NOTE: Qemu log file: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testimage/qemu_boot_log.20160701171015
| NOTE: SSH log file: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testimage/ssh_target_log.20160701171015
| NOTE: Created listening socket for qemu serial console on: 127.0.0.1:52417
| NOTE: Created listening socket for qemu serial console on: 127.0.0.1:34754
| NOTE: runqemu started, pid is 2950
| NOTE: waiting at most 60 seconds for qemu pid
| NOTE: runqemu exited with code 1
| NOTE: Output from runqemu:
| Please use simplified serial or kvm options instead
| 
| Continuing with the following parameters:
| KERNEL: [/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/deploy/images/qemuarm/zImage-qemuarm.bin]
| ROOTFS: [/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testimage/core-image-minimal-qemuarm-testimage.ext4]
| FSTYPE: [ext4]
| stty: standard input: Inappropriate ioctl for device
| Acquiring lockfile for tap0...
| Using preconfigured tap device &apos;tap0&apos;
| If this is not intended, touch /tmp/qemu-tap-locks/tap0.skip to make runqemu skip tap0.
| Running qemu-system-arm...
| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm -kernel /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/deploy/images/qemuarm/zImage-qemuarm.bin -net nic,model=virtio -net tap,vlan=0,ifname=tap0,script=no,downscript=no -M versatilepb -drive file=/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm/build/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-minimal/1.0-r0/testimage/core-image-minimal-qemuarm-testimage.ext4,if=virtio,format=raw -no-reboot -show-cursor -usb -usbdevice tablet -no-reboot -serial tcp:127.0.0.1:52417 -m 128 -serial tcp:127.0.0.1:34754 -append &quot;root=/dev/vda rw console=ttyAMA0,115200 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M highres=off rootfstype=ext4 console=tty1 console=ttyS0,115200n8 printk.time=1&quot;
| qemu-system-arm: -net tap,vlan=0,ifname=tap0,script=no,downscript=no: could not configure /dev/net/tun (tap0): Operation not permitted
| Releasing lockfile of preconfigured tap device &apos;tap0&apos;
| stty: standard input: Inappropriate ioctl for device
| stty: standard input: Inappropriate ioctl for device
| 
| NOTE: Sending SIGTERM to runqemu
| WARNING: Qemu ended unexpectedly, dump data from host is in /tmp/oe-saved-tests/201607011710_qemu
| DEBUG: Python function do_testimage finished
| ERROR: Function failed: do_testimage</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64303</commentid>
    <comment_count>1</comment_count>
    <who name="Bill Randle">bill.randle</who>
    <bug_when>2016-07-21 19:34:04 +0000</bug_when>
    <thetext>This is a portion of the strace log for the qemu-arm startup:

open(&quot;/dev/net/tun&quot;, O_RDWR) = 9
ioctl(9, TUNGETFEATURES, 0x7ffcee89ea6c) = 0
ioctl(9, TUNSETVNETHDRSZ, 0x7ffcee89ea68) = -1 EBADFD (File descriptor in bad state)
ioctl(9, TUNSETIFF, 0x7ffcee89ea70) = -1 EPERM (Operation not permitted)
close(9) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
write(2, &quot;qemu-system-i386: -net tap,vlan=&quot;..., 136qemu-system-i386: -net tap,vlan=0,ifname=tap0,script=no,downscript=no: could not configure /dev/net/tun (tap0): Operation not permitted
 ) = 136

It is the TUNSETIFF ioctl that is causing the problem.

It turns out the kernel tun driver looks for the user id AND group id of the process calling that ioctl to match. In our setup, the tap devices are owned by uid 6000 (pokybuild) and group 100 (users). The pokybuild user was not part of the users group.

Added pokybuild to the users group and restarted the workers and now the sajnity test is working.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>