copr-lxc4 icon indicating copy to clipboard operation
copr-lxc4 copied to clipboard

lxd: TestGetAllXattr fails on COPR

Open ganto opened this issue 9 months ago • 0 comments

Recently the TestGetAllXattr() test started failing on the Fedora COPR instances on all releases and all architectures except aarch64:

[...]
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.TMDaM8
+ umask 022
+ cd /builddir/build/BUILD
+ cd lxd-5.20
+ export GOPATH=/builddir/build/BUILDROOT/lxd-5.20-0.1.fc39.x86_64//usr/share/gocode:/usr/share/gocode
+ GOPATH=/builddir/build/BUILDROOT/lxd-5.20-0.1.fc39.x86_64//usr/share/gocode:/usr/share/gocode
+ export 'CGO_LDFLAGS_ALLOW=(-Wl,-wrap,pthread_create)|(-Wl,-z,now)'
+ CGO_LDFLAGS_ALLOW='(-Wl,-wrap,pthread_create)|(-Wl,-z,now)'
+ GO_LDFLAGS=' -X github.com/canonical/lxd/version=5.20'
+ GO_TEST_FLAGS='-buildmode pie -compiler gc -v -tags libsqlite3'
+ GO_TEST_EXT_LD_FLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  '
+ go-rpm-integration check -i github.com/canonical/lxd -b /builddir/build/BUILD/lxd-5.20/_build/bin -s /builddir/build/BUILD/lxd-5.20/_build -V 5.20-0.1.fc39 -p /builddir/build/BUILDROOT/lxd-5.20-0.1.fc39.x86_64 -g /usr/share/gocode -r '.*example.*' -v -t github.com/canonical/lxd/test -d github.com/canonical/lxd/lxc-to-lxd
Testing    in: /builddir/build/BUILD/lxd-5.20/_build/src
         PATH: /builddir/build/BUILD/lxd-5.20/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/lxd-5.20/_build:/builddir/build/BUILDROOT/lxd-5.20-0.1.fc39.x86_64//usr/share/gocode:/usr/share/gocode:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -v -tags libsqlite3 -ldflags " -X github.com/canonical/lxd/version=5.20 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  '"
      testing: github.com/canonical/lxd
[...]
github.com/canonical/lxd/shared
=== RUN   TestGetAllXattr
    util_linux_test.go:75: Expected to find extended attribute security.selinux with a value of unconfined_u:object_r:user_tmp_t:s0� on regular file but did not find it.
--- FAIL: TestGetAllXattr (0.00s)
=== RUN   TestURLEncode
--- PASS: TestURLEncode (0.00s)
=== RUN   TestUrlsJoin
--- PASS: TestUrlsJoin (0.00s)
=== RUN   TestFileCopy
--- PASS: TestFileCopy (0.00s)
=== RUN   TestDirCopy
--- PASS: TestDirCopy (0.00s)
=== RUN   TestReaderToChannel
--- PASS: TestReaderToChannel (0.01s)
=== RUN   TestGetExpiry
--- PASS: TestGetExpiry (0.00s)
=== RUN   TestHasKey
--- PASS: TestHasKey (0.00s)
=== RUN   TestRemoveElementsFromStringSlice
--- PASS: TestRemoveElementsFromStringSlice (0.00s)
=== RUN   TestKeyPairAndCA
--- PASS: TestKeyPairAndCA (0.00s)
=== RUN   TestGenerateMemCert
--- PASS: TestGenerateMemCert (0.00s)
FAIL
exit status 1
FAIL	github.com/canonical/lxd/shared	0.021s

RPM build warnings:

RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.TMDaM8 (%check)
    Setting %{thisgofilelist} = devel.file-list
    Setting %{currentgoipath} = github.com/canonical/lxd
    Setting %{currentgosourcedir} = /builddir/build/BUILD/lxd-5.20
    Setting %{currentgofilelist} = devel.file-list
    Setting %{currentversion} = 5.20
    Setting %{currentgoldflags} =  -X github.com/canonical/lxd/version=5.20
    Bad exit status from /var/tmp/rpm-tmp.TMDaM8 (%check)
Finish: rpmbuild lxd-5.20-0.1.fc39.src.rpm
Finish: build phase for lxd-5.20-0.1.fc39.src.rpm

I guess it has to do with the fact that the build system is having SELinux enabled and the build directory is on a tmpfs:

Storage (chroot, cache_topdir):
Filesystem        Type   Size  Used Avail Use% Mounted on
mock_chroot_tmpfs tmpfs  151G  207M  151G   1% /var/lib/mock/fedora-39-x86_64-1714234046.102517/root
mock_cache_tmpfs  tmpfs   35G  409M   34G   2% /var/cache/mock

I cannot reproduce this on my local machine (without SELinux)

ganto avatar Apr 28 '24 13:04 ganto