Merge lp:~matsubara/auto-package-testing/custom-meta-data-prepare-testbed into lp:auto-package-testing

Proposed by Diogo Matsubara
Status: Merged
Merged at revision: 327
Proposed branch: lp:~matsubara/auto-package-testing/custom-meta-data-prepare-testbed
Merge into: lp:auto-package-testing
Diff against target: 36 lines (+10/-2)
1 file modified
bin/prepare-testbed (+10/-2)
To merge this branch: bzr merge lp:~matsubara/auto-package-testing/custom-meta-data-prepare-testbed
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+213922@code.launchpad.net

Commit message

add option to allow custom metadata file to prepare-testbed script

Description of the change

This allows one to prepare a testebed using a custom meta-data file rather than using the hard coded one in the prepare-testbed. My use case for this is to prepare a testbed with multiple network-interfaces (e.g. https://pastebin.canonical.com/107680/) so we can use that testbed in the MAAS qa lab.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Just two little nitpicks:

 + METADATAFILE=$2

Should be quoted.

+ cat $METADATAFILE > $METADATA

Should be quoted and use cp.

Otherwise this LGTM.

Out of interest, what do you need this for? I'm asking because this whole lp:auto-package-testing thing will go away in the next cycle in favor of running adt-run directly (with adt-virt-{lxc,qemu}), so we need to fit your use case there, too.

Thanks!

review: Needs Fixing
327. By Diogo Matsubara

review comments: quote bash variables

Revision history for this message
Diogo Matsubara (matsubara) wrote :

Hi Martin, thanks for the review!

> Just two little nitpicks:
>
> + METADATAFILE=$2
>
> Should be quoted.

Quoted.

>
> + cat $METADATAFILE > $METADATA
>
> Should be quoted and use cp.

Changed to cp and quoted.

>
> Otherwise this LGTM.
>
> Out of interest, what do you need this for? I'm asking because this whole lp
> :auto-package-testing thing will go away in the next cycle in favor of running
> adt-run directly (with adt-virt-{lxc,qemu}), so we need to fit your use case
> there, too.

Thanks for the heads up! In MAAS CI we use auto-package-testing to prepare a testbed and run dep8 tests for MAAS. The VM prepared by a-p-t is specially crafted with cloud-init and qemu/kvm -config file to have 3 network interfaces so we can access the bridges in the host machine in the QA lab. That way we can test that MAAS server can access the rest of the QA lab, handle IPMI configuration, etc. Are there docs/blueprints discussing this a-p-t change? I'd be interested in reading more so I can prepare for the changes and move the MAAS infrastructure to it when the time comes.

>
> Thanks!

Thank you!

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks, merged.

> Are there docs/blueprints discussing this a-p-t change?

Already answered on IRC, but for the record:

 - We want to move to running adt-run directly, without wrappers: /usr/share/doc/autopkgtest/README.running-tests.gz
 - We want to move away from jenkins and the a-p-t scripts to https://wiki.debian.org/MartinPitt/DistributedDebCI

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/prepare-testbed'
2--- bin/prepare-testbed 2014-02-14 09:08:19 +0000
3+++ bin/prepare-testbed 2014-04-03 12:16:19 +0000
4@@ -32,6 +32,7 @@
5 KVMCMD=kvm
6 APTURI=http://archive.ubuntu.com/ubuntu
7 USERDATAFILE=""
8+METADATAFILE=""
9
10 # New qemu in raring replaces kvm and requires explicit activation of kvm
11 # virtualization support
12@@ -128,6 +129,9 @@
13 -u|--user-data)
14 USERDATAFILE=$2
15 shift 2;;
16+ -m|--meta-data)
17+ METADATAFILE="$2"
18+ shift 2;;
19 --) shift ; break ;;
20 *) usage;;
21 esac
22@@ -206,8 +210,12 @@
23 PUBKEY="$( cat ${KEYPATH}.pub )"
24 fi
25
26-LOCALHOSTNAME=autopkgtest
27-{ echo instance-id: nocloud; echo local-hostname: $LOCALHOSTNAME; } > $METADATA
28+if [ -f "$METADATAFILE" ]; then
29+ cp "$METADATAFILE" "$METADATA"
30+else
31+ LOCALHOSTNAME=autopkgtest
32+ { echo instance-id: nocloud; echo local-hostname: $LOCALHOSTNAME; } > $METADATA
33+fi
34
35 TZ="Etc/UTC"
36 [ -e /etc/timezone ] && TZ=$(cat /etc/timezone)

Subscribers

People subscribed via source and target branches