[[PATCH][debci]] bin/debci-setup: Do not set the timestamp if setup failed

Antonio Terceiro terceiro at debian.org
Sat Sep 3 12:01:31 UTC 2016


Hi Brandon,

Thanks a lot for looking into this.

On Thu, Sep 01, 2016 at 11:38:03PM -0400, Brandon F. wrote:
> If the system does not have a dependency installed or an error occurs the
> setup script fails and creates a timestamp for the testbed.
> 
> This blocks subsequent attempts to setup/update the testbed since it finds the
> existing timestamp.
> 
> Instead, the setup script should create a temporary timestamp for the testbed,
> remove it when setup is successful, and then create the official timestamp.

Not sure this is a good solution. The real problem is making sure that
the create-testbed scripts actually exit with non-zero if something goes
wrong, and then debci-setup can invalidate the timestamp centrally. What
is happening now is that create-testbed fails but still exists with 0.

> ---
>  backends/lxc/create-testbed     |  2 ++
>  backends/schroot/create-testbed |  1 +
>  backends/schroot/update-testbed |  2 ++
>  bin/debci-setup                 | 14 +++++++++++---
>  lib/environment.sh              |  1 +
>  lib/functions.sh                |  6 ++++++
>  6 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/backends/lxc/create-testbed b/backends/lxc/create-testbed
> index cc17ab5..7245a5e 100755
> --- a/backends/lxc/create-testbed
> +++ b/backends/lxc/create-testbed
> @@ -117,3 +117,5 @@ chroot "$rootfs"  \
>      --shell /bin/sh \
>      --home /home/debci \
>      debci
> +
> +remove_testbed_setup_progress_timestamp

having to put a call like this ...

> diff --git a/backends/schroot/create-testbed b/backends/schroot/create-testbed
> index fda596e..08c3702 100755
> --- a/backends/schroot/create-testbed
> +++ b/backends/schroot/create-testbed
> @@ -147,3 +147,4 @@ if ! which schroot >/dev/null; then
>  fi
>  
>  setup_suite
> +remove_testbed_setup_progress_timestamp

... in every backend script resposible for setting up a testbed ...

> diff --git a/backends/schroot/update-testbed b/backends/schroot/update-testbed
> index 69c76f0..4adebe4 100755
> --- a/backends/schroot/update-testbed
> +++ b/backends/schroot/update-testbed
> @@ -26,3 +26,5 @@ DEBIAN_FRONTEND=noninteractive schroot \
>    --directory / \
>    --user root \
>    -- apt-get dist-upgrade -q -y
> +
> +remove_testbed_setup_progress_timestamp

... is a certain recipe for future breakage, because new backends will
come and we will forget to add those.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160903/e88da631/attachment.sig>


More information about the autopkgtest-devel mailing list