From 8169439498422bee9ad2ac4f7c144e93635a3d6c Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 25 Nov 2024 01:57:42 -0600 Subject: [PATCH] [autopkgtest] Further refactoring to properly run the autopkgtest. --- debian/changelog | 6 ++++++ debian/rules | 5 +++-- debian/tests/control | 6 +++--- snapd-seed-glue/tests/cli-tests.cpp | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1b5e754..0a501b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +snapd-extra-utils (1.0.6) UNRELEASED; urgency=medium + + * [autopkgtest] Further refactoring to properly run the autopkgtest. + + -- Simon Quigley Mon, 25 Nov 2024 01:12:04 -0600 + snapd-extra-utils (1.0.5) plucky; urgency=medium * [autopkgtest] Convert the snapd-seed-glue autopkgtest to C++. diff --git a/debian/rules b/debian/rules index 0a840d4..9ad8751 100755 --- a/debian/rules +++ b/debian/rules @@ -3,11 +3,12 @@ export DH_VERBOSE = 1 export GO111MODULE = off export GOPATH=/usr/share/gocode export GOCACHE=$(CURDIR)/.gocache +export NUM_CPUS = $(shell nproc) %: dh $@ override_dh_auto_build: (cd snapd-seed-glue && go build -gcflags="all=-N -l" -ldflags="-compressdwarf=false" -o snapd-seed-glue) - (cd snapd-seed-glue/tests && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . && make -j2 && mv snapd_seed_glue_test ../../debian/tests/snapd-seed-glue) - (cd snapd-installation-monitor && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . && make -j2) + (cd snapd-seed-glue/tests && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . && make -j${NUM_CPUS}) + (cd snapd-installation-monitor && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . && make -j${NUM_CPUS}) diff --git a/debian/tests/control b/debian/tests/control index b3dc94f..3cdeb1f 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,3 @@ -Tests: snapd-seed-glue -Depends: snapd-seed-glue -Restrictions: needs-internet +Test-Command: snapd-seed-glue/tests/snapd_seed_glue_test +Depends: snapd-seed-glue, tree +Restrictions: needs-internet, build-needed diff --git a/snapd-seed-glue/tests/cli-tests.cpp b/snapd-seed-glue/tests/cli-tests.cpp index c21553f..7e1b668 100644 --- a/snapd-seed-glue/tests/cli-tests.cpp +++ b/snapd-seed-glue/tests/cli-tests.cpp @@ -48,7 +48,7 @@ void confirm_success() { } void run_snapd_seed_glue(const std::vector& args) { - std::string cmd = "/usr/bin/snapd-seed-glue --verbose --seed hello_test"; + std::string cmd = "snapd-seed-glue/snapd-seed-glue --verbose --seed hello_test"; for (const auto& arg : args) { cmd += " " + arg; }