Gavin Panella has proposed merging lp:~allenap/maas/acceptance into lp:maas.
Requested reviews: MAAS Maintainers (maas-maintainers) For more details, see: https://code.launchpad.net/~allenap/maas/acceptance/+merge/123078 -- https://code.launchpad.net/~allenap/maas/acceptance/+merge/123078 Your team MAAS Maintainers is requested to review the proposed merge of lp:~allenap/maas/acceptance into lp:maas.
=== modified file '.bzrignore' --- .bzrignore 2012-07-28 07:44:58 +0000 +++ .bzrignore 2012-09-18 19:28:21 +0000 @@ -4,6 +4,10 @@ ./.coverage ./.installed.cfg ./.noseids +./acceptance/*.build +./acceptance/*.changes +./acceptance/*.deb +./acceptance/source ./bin ./build ./celerybeat-schedule @@ -13,7 +17,6 @@ ./docs/_autosummary ./docs/_build ./docs/api.rst -dropin.cache ./eggs ./include ./lib @@ -27,3 +30,4 @@ ./src/maasserver/static/js/enums.js ./TAGS ./tags +dropin.cache === modified file 'Makefile' --- Makefile 2012-09-12 14:44:34 +0000 +++ Makefile 2012-09-18 19:28:21 +0000 @@ -136,6 +136,7 @@ bin/py -m src/maasserver/utils/jsenums $(py_enums) > $@ clean: + $(MAKE) -C acceptance $@ find . -type f -name '*.py[co]' -print0 | xargs -r0 $(RM) find . -type f -name '*~' -print0 | xargs -r0 $(RM) $(RM) -r media/demo/* media/development === added directory 'acceptance' === added file 'acceptance/Makefile' --- acceptance/Makefile 1970-01-01 00:00:00 +0000 +++ acceptance/Makefile 2012-09-18 19:28:21 +0000 @@ -0,0 +1,86 @@ +include /etc/lsb-release + +packaging := lp:~maas-maintainers/maas/packaging + +# Special-case Precise. +ifeq ($(DISTRIB_CODENAME),precise) +packaging := $(packaging).precise +endif + +upstream := $(abspath ..) +packages = $(abspath $(wildcard *.deb)) +image := maas-$(DISTRIB_CODENAME) + +## + +define ephexec +sudo LC_ALL=C SSH_ASKPASS=$(abspath ubuntupass) setsid \ + lxc-start-ephemeral -b $(abspath .) -o $(image) -u ubuntu -- \ + DEBIAN_FRONTEND=noninteractive SUDO_ASKPASS=$(abspath ubuntupass) +endef + +define ephexec-make +$(ephexec) $(abspath with-make) make -C $(abspath .) +endef + +## + +test: services sudo build image + $(ephexec-make) $@-inner + +test-inner: + sudo -AE dpkg --install -- $(packages) + sudo -AE apt-get --fix-broken --assume-yes install + +build: services sudo source source/debian + $(ephexec-make) $@-inner + +build-inner: + sudo -AE apt-get --assume-yes install devscripts debhelper dh-apport + cd source && debuild -i -us -uc -b + +image: /var/lib/lxc/$(image) + +lxc: + @service $@ status + +lxc-net: + @service $@ status + +services: lxc lxc-net + +## + +source: + bzr export --uncommitted $@ $(upstream) + +source/debian: | source + bzr export $@ $(packaging)/debian + +/var/lib/lxc/$(image): + sudo lxc-create -n $(image) -t ubuntu + +## + +sudo: + @sudo -v + +clean: + $(RM) -r source *.build *.changes *.deb + +## + +define phony + build + clean + image + lxc + lxc-net + services + sudo + test +endef + +phony := $(sort $(strip $(phony))) + +.PHONY: $(phony) === added file 'acceptance/README' --- acceptance/README 1970-01-01 00:00:00 +0000 +++ acceptance/README 2012-09-18 19:28:21 +0000 @@ -0,0 +1,13 @@ +MAAS Packaging Acceptance Testing +--------------------------------- + +The `test` make target will build binary packages for the current +branch using the latest packaging branch from Launchpad, and then run +the "test" script (from the current directory) in an ephemeral LXC +container. + +Consider the "test" script, as it stands, as a bootstrap point for +further testing. It may not be suitable for full automated end-to-end +testing of MAAS, so be clear about what you need to test before +investing work here. OTOH, it is a good place to test that the +packages install and configure themselves as expected. === added file 'acceptance/ubuntupass' --- acceptance/ubuntupass 1970-01-01 00:00:00 +0000 +++ acceptance/ubuntupass 2012-09-18 19:28:21 +0000 @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo ubuntu === added file 'acceptance/with-make' --- acceptance/with-make 1970-01-01 00:00:00 +0000 +++ acceptance/with-make 2012-09-18 19:28:21 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Copyright 2012 Canonical Ltd. This software is licensed under the +# GNU Affero General Public License version 3 (see the file LICENSE). + +# Exit immediately if a command exits with a non-zero status. +set -o errexit +# Treat unset variables as an error when substituting. +set -o nounset + +# Ensure that GNU make is installed. +sudo -AE apt-get install --assume-yes make + +exec "$@"
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp

