Control: tag -1 patch

Hello again,

This patch should do it. However, I only ran the unit tests, I didn't do any
kind of integration testing as I'm not currently set up for this.

The unit tests currently fail a lot with errors like

  test_batch_skip_after_result
  ls: cannot access 
'/tmp/tmp.VppB3FL9Hv/data/packages/unstable/amd64/m/mypkg/*.autopkgtest.log.gz':
 No such file or directory
  ASSERT:expected:<1> but was:<0>

But this is the case with and without this patch; I think it's unrelated.

Martin
From 6ea0659d331b9a26ed89a66d054949cadc05e213 Mon Sep 17 00:00:00 2001
From: Martin Pitt <[email protected]>
Date: Sun, 2 Jul 2017 13:02:34 +0200
Subject: [PATCH] Move from obsolete adt-run to autopkgtest CLI

autopkgtest 4.0 deprecated "adt-run" a year ago, let's finally move to
the current "autopkgtest" CLI.

Bump autopkgtest dependency accordingly.

Closes #866867
---
 backends/fake/test-package    |  2 +-
 backends/lxc/create-testbed   |  4 ++--
 backends/lxc/test-package     |  2 +-
 backends/null/test-package    |  2 +-
 backends/schroot/test-package |  2 +-
 bin/debci-generate-index      |  2 +-
 bin/debci-test                |  2 +-
 debian/control                |  2 +-
 docs/MAINTAINERS.md           | 29 +++++++++++++++--------------
 docs/TUTORIAL.md              | 18 +++++++++---------
 test/test_worker.sh           |  2 +-
 11 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/backends/fake/test-package b/backends/fake/test-package
index 136fc06..32361d8 100755
--- a/backends/fake/test-package
+++ b/backends/fake/test-package
@@ -78,7 +78,7 @@ if ENV["DEBCI_FAKE_KILLPARENT"]
   end
 end
 
-log = log + "adt-run [%s]: finished\n" % Time.now.strftime('%Y-%m-%d %H:%M:%S')
+log = log + "autopkgtest [%s]: finished\n" % Time.now.strftime('%Y-%m-%d 
%H:%M:%S')
 
 File.open(File.join(outdir, 'log'), 'w') do |f|
   f.puts log
diff --git a/backends/lxc/create-testbed b/backends/lxc/create-testbed
index ce307c8..d077839 100755
--- a/backends/lxc/create-testbed
+++ b/backends/lxc/create-testbed
@@ -75,11 +75,11 @@ if [ -n "$http_proxy" ]; then
 fi
 
 
-adt-build-lxc $distro $debci_suite $debci_arch
+autopkgtest-build-lxc $distro $debci_suite $debci_arch
 
 LXC_PATH=$(lxc-config lxc.lxcpath) || LXC_PATH=/var/lib/lxc
 
-rootfs=$LXC_PATH/adt-${debci_suite}-${debci_arch}/rootfs
+rootfs=$LXC_PATH/autopkgtest-${debci_suite}-${debci_arch}/rootfs
 # FIXME duplicates logic in bin/debci-setup-chdist && 
backends/schroot/create-testbed
 if [ "$distro" = debian ]; then
   if [ "$debci_suite" = sid ]; then
diff --git a/backends/lxc/test-package b/backends/lxc/test-package
index a1c6378..38ed0ab 100755
--- a/backends/lxc/test-package
+++ b/backends/lxc/test-package
@@ -29,7 +29,7 @@ outdir="$2"
 container_name=$(basename ${package})-$(date +%s)
 
 rc=0
-adt-run --user debci --output-dir "$outdir" "$package" --apt-upgrade --- lxc 
--sudo --name ${container_name} adt-${debci_suite}-${debci_arch} || rc=$?
+autopkgtest --user debci --output-dir "$outdir" --apt-upgrade "$package" -- 
lxc --sudo --name ${container_name} autopkgtest-${debci_suite}-${debci_arch} || 
rc=$?
 
 echo $rc > "$outdir/exitcode"
 exit $rc
diff --git a/backends/null/test-package b/backends/null/test-package
index 509b51f..8ca029f 100755
--- a/backends/null/test-package
+++ b/backends/null/test-package
@@ -24,6 +24,6 @@ package="$1"
 outdir="$2"
 
 rc=0
-adt-run --output-dir "$outdir" "$package" --- null || rc=$?
+autopkgtest --output-dir "$outdir" "$package" -- null || rc=$?
 echo $rc > "$outdir/exitcode"
 exit $rc
diff --git a/backends/schroot/test-package b/backends/schroot/test-package
index c944fb2..43dd935 100755
--- a/backends/schroot/test-package
+++ b/backends/schroot/test-package
@@ -26,6 +26,6 @@ outdir="$2"
 session_id="${debci_chroot_name}-$(basename "$package")"
 
 rc=0
-adt-run --user debci --output-dir "$outdir" "$package" --apt-upgrade --- 
adt-virt-schroot --session-id="${session_id}" "${debci_chroot_name}" || rc=$?
+autopkgtest --user debci --output-dir "$outdir" --apt-upgrade "$package" -- 
schroot --session-id="${session_id}" "${debci_chroot_name}" || rc=$?
 echo $rc > "$outdir/exitcode"
 exit $rc
diff --git a/bin/debci-generate-index b/bin/debci-generate-index
index 1a1586d..842607c 100755
--- a/bin/debci-generate-index
+++ b/bin/debci-generate-index
@@ -166,7 +166,7 @@ exitcode_to_statusmsg()
       ;;
     *)
       status=tmpfail
-      message="Unexpected adt-run exit code $code"
+      message="Unexpected autopkgtest exit code $code"
       ;;
   esac
 }
diff --git a/bin/debci-test b/bin/debci-test
index aadeaa9..423ab8f 100755
--- a/bin/debci-test
+++ b/bin/debci-test
@@ -21,7 +21,7 @@ debci_base_dir=$(readlink -f $(dirname $(readlink -f $0))/..)
 . $debci_base_dir/lib/functions.sh
 
 process_package() {
-  # output directory for test-package/adt-run
+  # output directory for test-package/autopkgtest
   run_id=$(date +%Y%m%d_%H%M%S)
   local base_dir="$(autopkgtest_incoming_dir_for_package "$pkg")"
   adt_out_dir="${base_dir}/${run_id}"
diff --git a/debian/control b/debian/control
index a59d603..398fe9f 100644
--- a/debian/control
+++ b/debian/control
@@ -64,7 +64,7 @@ Package: debci-worker
 Architecture: all
 Depends: debci (= ${binary:Version}),
          autodep8 (>= 0.2~),
-         autopkgtest (>= 3.20),
+         autopkgtest (>= 4),
          lxc | schroot,
          ${misc:Depends},
          ${shlibs:Depends}
diff --git a/docs/MAINTAINERS.md b/docs/MAINTAINERS.md
index 6be2fd5..aa8817e 100644
--- a/docs/MAINTAINERS.md
+++ b/docs/MAINTAINERS.md
@@ -18,7 +18,7 @@ To run the test suite from **the root of a source package** 
against the
 currently installed packages, run:
 
 ```
-$ adt-run --output-dir /tmp/output-dir ./ --- null
+$ autopkgtest --output-dir /tmp/output-dir -B  . -- null
 ```
 
 For more details, see the documentation for the `autopkgtest` package.
@@ -70,25 +70,26 @@ $ sudo debci setup
 This might take a few minutes since it will create a fresh container from
 scratch.
 
-Now to actually run tests, we'll use the adt-run tool from `autopkgtest`
-directly. The following examples assume your architecture is amd64, replace it
-by your actual architecture if that is not the case.
+Now to actually run tests, we'll use `autopkgtest` directly. The following
+examples assume your architecture is amd64, replace it by your actual
+architecture if that is not the case.
 
 To run the test suite **from a source package in the archive**, just pass the
-_source package name_ to adt-run:
+_source package name_ to autopkgtest:
 
 ```
-$ adt-run --user debci --output-dir /tmp/output-dir SOURCEPACKAGE --- lxc 
--sudo adt-sid-amd64
+$ autopkgtest --user debci --output-dir /tmp/output-dir SOURCEPACKAGE \
+  -- lxc --sudo autopkgtest-sid-amd64
 ```
 
 To run the test suite against **a locally-built source package**, using the
 test suite from that source package and the binary packages you just built, you
-can pass the `.changes` file to adt-run:
+can pass the `.changes` file to autopkgtest:
 
 ```
-$ adt-run --user debci --output-dir /tmp/output-dir \
+$ autopkgtest --user debci --output-dir /tmp/output-dir \
   /path/to/PACKAGE_x.y-z_amd64.changes \
-  --- lxc --sudo adt-sid-amd64
+  -- lxc --sudo autopkgtest-sid-amd64
 ```
 
 For more details, see the documentation for the `autopkgtest` package.
@@ -133,20 +134,20 @@ The following examples assume:
 * architecture = `amd64`
 
 To run the test suite **from a source package in the archive**, you pass the
-_package name_ to adt-run:
+_package name_ to autopkgtest:
 
 ```
-$ adt-run --user debci --output-dir /tmp/output-dir SOURCEPACKAGE --- schroot 
debci-unstable-amd64
+$ autopkgtest --user debci --output-dir /tmp/output-dir SOURCEPACKAGE -- 
schroot debci-unstable-amd64
 ```
 
 To run the test suite against **a locally-built source package**, using the
 test suite from that source package and the binary packages you just built, you
-can pass the `.changes` file to adt-run:
+can pass the `.changes` file to autopkgtest:
 
 ```
-$ adt-run --user debci --output-dir /tmp/output-dir \
+$ autopkgtest --user debci --output-dir /tmp/output-dir \
   /path/to/PACKAGE_x.y-z_amd64.changes \
-  --- schroot debci-unstable-amd64
+  -- schroot debci-unstable-amd64
 ```
 
 For more details, see the documentation for the `autopkgtest` package.
diff --git a/docs/TUTORIAL.md b/docs/TUTORIAL.md
index 58c7f30..6135e17 100644
--- a/docs/TUTORIAL.md
+++ b/docs/TUTORIAL.md
@@ -190,22 +190,22 @@ in the current directory on the current system.
 It is somewhat limited since it will possibly skip some tests but is useful as 
a
 first step.
 
-### adt-run
+### autopkgtest
 
-adt-run, from autopkgtest, can run tests from the current directory, the USC, 
a changefile,
+autopkgtest can run tests from the current directory, the DSC, a changefile,
 or pass additional binary DEBs.
 
 ```
-$ adt-run [adt-run options] --- [virtualization args]
+$ autopkgtest [options] -- [virtualization args]
 ```
 
-Three dashes are passed to adt-run after the input options followed by 
virtualization options
+Two dashes are passed to autopkgtest after the input options followed by 
virtualization options
 which specifies which virtual environment to use to run the tests.
 
 Let's look at a basic example:
 
 ```
-$ adt-run ./ --- null
+$ autopkgtest . -- null
 ```
 
 The command above runs the tests from the source package at the current 
directory, on the
@@ -214,7 +214,7 @@ current system. Note the `null` argument for the 
virtualization.
 Let's look at an example that uses virtualization:
 
 ```
-$ adt-run -u debci /path/to/foo_1.2.3.-1_amd64.changes --- schroot 
debci-unstable-amd64
+$ autopkgtest -u debci /path/to/foo_1.2.3.-1_amd64.changes -- schroot 
debci-unstable-amd64
 ```
 
 The command above runs tests from the source referenced by the `changes` file, 
using
@@ -227,7 +227,7 @@ Note: `ssh` assumes that you have a driver to instantiate 
VMs on the cloud or an
 location.
 
 ```
-$ adt-run -u debci /path/to/foo_1.2.3-1_amd64.changes --- lxc adt-sid-amd64
+$ autopkgtest -u debci /path/to/foo_1.2.3-1_amd64.changes -- lxc 
autopkgtest-sid-amd64
 ```
 
 
@@ -279,9 +279,9 @@ EOF
 
 . shunit2
 ```
-Then, we can run it with sadt or adt-run.
+Then, we can run it with sadt or autopkgtest.
 
-Note: `sadt` hides output and `adt-run ./ --- null` gives full output.
+Note: `sadt` hides output and `autopkgtest . -- null` gives full output.
 
 
 # Miscellaneous
diff --git a/test/test_worker.sh b/test/test_worker.sh
index 51dd3a7..64262e5 100644
--- a/test/test_worker.sh
+++ b/test/test_worker.sh
@@ -13,7 +13,7 @@ request() {
 settle_processes() {
   local timeout=100
   while [ $timeout -gt 0 ]; do
-    PS=$(ps hx -o pid,comm|egrep 
"(debci|test-package|adt-run|amqp-consume)"|sort -u)
+    PS=$(ps hx -o pid,comm|egrep 
"(debci|test-package|autopkgtest|amqp-consume)"|sort -u)
     [ -n "$PS" ] || break
     timeout=$((timeout - 1))
     sleep 0.1
-- 
2.13.0

Attachment: signature.asc
Description: PGP signature

Reply via email to