[Pkg-sssd-devel] Bug#962626: nss-wrapper: Please make autopkgtests cross-test-friendly
Steve Langasek
steve.langasek at canonical.com
Wed Jun 10 22:08:04 BST 2020
Package: nss-wrapper
Version: 1.1.11-1
Severity: minor
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu groovy ubuntu-patch
Hi Timo,
In Ubuntu, we have moved the i386 architecture to a compatibility-only layer
on amd64, and therefore we have also moved our autopkgtest infrastructure to
test i386 binaries in a cross-environment.
This requires changes to some tests so that they are cross-aware and can do
the right thing.
The nss-wrapper tests currently fail in this environment, because they are
build tests that do not invoke the toolchain in a cross-aware manner. I've
verified that the attached patch lets the tests successfully build (and run)
i386 tests on an amd64 host.
Note that upstream autopkgtest doesn't currently set DEB_HOST_ARCH so this
is a complete no-op in Debian for the moment. Support for cross-testing in
autopkgtest is currently awaiting review at
https://salsa.debian.org/ci-team/autopkgtest/merge_requests/69 and once
landed, will still have no effect unless autopkgtest is invoked with a '-a'
option. So this change should be safe to land in your package despite this
not being upstream in autopkgtest.
Thanks for considering,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek at ubuntu.com vorlon at debian.org
-------------- next part --------------
diff -Nru nss-wrapper-1.1.11/debian/tests/control nss-wrapper-1.1.11/debian/tests/control
--- nss-wrapper-1.1.11/debian/tests/control 2020-04-02 10:23:15.000000000 -0700
+++ nss-wrapper-1.1.11/debian/tests/control 2020-06-10 14:03:08.000000000 -0700
@@ -1,10 +1,11 @@
Tests: tests
Depends: libnss-wrapper,
- gcc, libc-dev,
- cmake (>= 2.8.8-3~), make,
+ build-essential,
+ libc6-dev,
+ cmake (>= 2.8.8-3~),
libcmocka-dev,
netbase
Restrictions: allow-stderr
Tests: adequate
-Depends: libnss-wrapper, adequate
+Depends: libnss-wrapper, adequate:native
diff -Nru nss-wrapper-1.1.11/debian/tests/tests nss-wrapper-1.1.11/debian/tests/tests
--- nss-wrapper-1.1.11/debian/tests/tests 2020-04-02 10:23:15.000000000 -0700
+++ nss-wrapper-1.1.11/debian/tests/tests 2020-06-10 13:54:51.000000000 -0700
@@ -5,7 +5,19 @@
rm -rf obj debian
mkdir obj
cd obj
-cmake .. -DUNIT_TESTING=1
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+ cat <<EOF > "$ADTTMP/toolchain.cmake"
+set(CMAKE_C_COMPILER $DEB_HOST_GNU_TYPE-gcc)
+set(CMAKE_CXX_COMPILER $DEB_HOST_GNU_TYPE-g++)
+set(PKG_CONFIG_EXECUTABLE $DEB_HOST_GNU_TYPE-pkg-config)
+EOF
+ CCFILE=-DCMAKE_TOOLCHAIN_FILE="$ADTTMP/toolchain.cmake"
+else
+ CCFILE=
+fi
+
+cmake .. "$CCFILE" -DUNIT_TESTING=1
make -C tests/
cd tests
sed -e 's#\(LD_PRELOAD=\)[^;]*/\(libnss_wrapper.so\)#\1\2#' -i CTestTestfile.cmake
More information about the Pkg-sssd-devel
mailing list