summaryrefslogtreecommitdiffstats
path: root/tests/docker
Commit message (Collapse)AuthorAgeFilesLines
* docker.py: Improve subprocess exit code handlingFam Zheng2017-07-171-7/+12
| | | | | | | | | | | | | A few error handlings are missing because we ignore the subprocess exit code, for example "docker build" errors are currently ignored. Introduce _do_check() aside the existing _do() method and use it in a few places. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170712075528.22770-3-famz@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker.py: Drop infile parameterFam Zheng2017-07-171-4/+2Star
| | | | | | | | | The **kwargs can do this just well. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170712075528.22770-2-famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: Don't enable networking as a side-effect of DEBUG=1Daniel P. Berrange2017-07-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | When trying to debug problems with tests it is natural to set DEBUG=1 when starting the docker environment. Unfortunately this has a side-effect of enabling an eth0 network interface in the container, which changes the operating environment of the test suite. IOW tests with fail may suddenly start working again if DEBUG=1 is set, due to changed network setup. Add a separate NETWORK variable to allow enablement of networking separately from DEBUG=1. This can be used in two ways. To enable the default docker network backend make docker-test-build@fedora NETWORK=1 while to enable a specific network backend, eg join the network associated with the container 'wibble': make docker-test-build@fedora NETWORK=container:wibble Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170713144352.2212-1-berrange@redhat.com> [Drop the superfluous second $(subst ...). - Fam] Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: add mipsel build targetPhilippe Mathieu-Daudé2017-06-212-0/+30
| | | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [AJB: remove apt-fake kludge] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: add extra libs to s390x target to extend codebase coveragePhilippe Mathieu-Daudé2017-06-211-0/+10
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: add extra libs to arm64 target to extend codebase coveragePhilippe Mathieu-Daudé2017-06-211-0/+11
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: add extra libs to armhf target to extend codebase coveragePhilippe Mathieu-Daudé2017-06-211-0/+11
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: use eatmydata in debian arm64 imagePhilippe Mathieu-Daudé2017-06-211-2/+5
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: use eatmydata in debian armhf imagePhilippe Mathieu-Daudé2017-06-211-2/+5
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: use eatmydata, install common build packages in base imagePhilippe Mathieu-Daudé2017-06-211-1/+4
| | | | | | | | | The common build packages are: build-essential clang git bison flex Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [AJB: fixups following stretch update] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: use better regex to generate deb-src entriesPhilippe Mathieu-Daudé2017-06-211-1/+1
| | | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [AJB: fixed up following dropping emdebian] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: install ca-certificates package in base imagePhilippe Mathieu-Daudé2017-06-211-1/+1
| | | | | | | | | | | | | | | | | | | Resolve SSL verification issue at shippable container's git_sync stage: shippable logs: -------------- git_sync - ssh-agent bash -c 'ssh-add /tmp/ssh/01_deploy; git clone https://github.com/philmd/qemu.git /root/src/github.com/philmd/qemu' Identity added: /tmp/ssh/01_deploy (rsa w/o comment) Cloning into '/root/src/github.com/philmd/qemu'... fatal: unable to access 'https://github.com/philmd/qemu.git/': Problem with the SSL CA cert (path? access rights?) retrying 1 of 3 times... Suggested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [AJB: fixed re-base conflict following stretch updates] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: rebuild image if 'extra files' checksum does not matchPhilippe Mathieu-Daudé2017-06-211-3/+13
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: add --include-files argument to 'build' commandPhilippe Mathieu-Daudé2017-06-212-3/+12
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: let _copy_with_mkdir() sub_path argument be optionalPhilippe Mathieu-Daudé2017-06-211-1/+1
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: update qemu:debian base following stretch releaseAlex Bennée2017-06-211-8/+0Star
| | | | | | | | | | | Debian has now released Stretch as its new stable. As we track debian:stable-slim this has a few consequences. For one thing we can now drop the emdebian hacks as cross compilers are part of the official repositories now. However we do loose the ability to build against powerpc (not ppc64) since that is no longer a release architecture. Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
* docker: Add flex and bison to centos6 imageFam Zheng2017-06-161-1/+1
| | | | | | | | | | | | | | | | | | Currently there are warnings about flex and bison being missing when building in the centos6 image: make[1]: flex: Command not found BISON dtc-parser.tab.c make[1]: bison: Command not found Add them. Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170524005206.31916-1-famz@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: Add libaio to fedora imageFam Zheng2017-06-161-1/+1
| | | | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170505032340.26467-5-famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: Add bzip2 and hostname to fedora imageFam Zheng2017-06-161-1/+1
| | | | | | | | | | | It is used by qemu-iotests. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170505032340.26467-3-famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: Run tests with current userFam Zheng2017-06-161-1/+1
| | | | | | | | | | | | | We've used --add-current-user to create a user in the image, use it to run tests, because root has too much priviledge, and can surprise test cases. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170505032340.26467-2-famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker/dockerfiles/debian-s390-cross: include clangAlex Bennée2017-03-101-2/+2
| | | | | | | | | | | | | It's a silly little limitation on Shippable that is looks for clang in the container even though we won't use it. The arm/aarch64 cross builds inherit this from debian.docker but as we needed to use debian-testing for this we add it here. We also collapse the update step into one RUN line to remove and intermediate layer of the docker build. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20170306112848.659-1-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker: support proxy / corporate firewallPhilippe Mathieu-Daudé2017-03-071-0/+6
| | | | | | | | | | | | if ftp_proxy/http_proxy/https_proxy standard environment variables available, pass them to the docker daemon to build images. this is required when building behind corporate proxy/firewall, but also help when using local cache server (ie: apt/yum). Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170306205520.32311-1-f4bug@amsat.org> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* new: dockerfiles/debian-s390-crossAlex Bennée2017-02-281-0/+22
| | | | | | | | | | | | | | | | This adds an s390 cross build target to our library of docker setups. There is an issue with the xfslibs-dev:s390x package having a clash so we do a || apt-get -f install to fixup the rest of the dependencies. This doesn't build on the debian.docker file as we are using the multilib compiler which is only available in stretch (the current testing repo). Signed-off-by: Alex Bennée <alex.bennee@linaro.org> CC: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <20170227143028.16428-2-alex.bennee@linaro.org> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: Install python2 explicitly in docker imageFam Zheng2017-02-241-1/+1
| | | | | | | | | | | Python is no longer installed implicitly, but the QEMU build system requires it. List it in PACKAGES. Reported-by: Auger Eric <eric.auger@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170222021801.28658-1-famz@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* new: debian docker targets for cross-compilingAlex Bennée2017-02-245-1/+60
| | | | | | | | | | | | | | | | | | | | This provides a basic Debian install with access to the emdebian cross compilers. The debian-armhf-cross and debian-arm64-cross targets build on the basic Debian image to allow cross compiling to those targets. A new environment variable (QEMU_CONFIGURE_OPTS) is set as part of the docker container and passed to the build to specify the --cross-prefix. The user still calls the build in the usual way, for example: make docker-test-build@debian-arm64-cross \ TARGET_LIST="aarch64-softmmu,aarch64-linux-user" Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170220105139.21581-3-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker: add basic user mapping supportAlex Bennée2017-02-242-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all docker builds are done by exporting a tarball to the docker container and running the build as the containers root user. Other use cases are possible however and it is possible to map a part of users file-system to the container. This is useful for example for doing cross-builds of arbitrary source trees. For this to work smoothly the container needs to have a user created that maps cleanly to the host system. This adds a -u option to the docker script so that: DEB_ARCH=armhf DEB_TYPE=stable ./tests/docker/docker.py build \ -u --include-executable=arm-linux-user/qemu-arm \ debian:armhf ./tests/docker/dockerfiles/debian-bootstrap.docker Will build a container that can then be run like: docker run --rm -it -v /home/alex/lsrc/qemu/risu.git/:/src \ --user=alex:alex -w /src/ debian:armhf \ sh -c "make clean && ./configure -s && make" All docker containers built will add the current user unless explicitly disabled by specifying NOUSER when invoking the Makefile: make docker-image-debian-armhf-cross NOUSER=1 Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Fam Zheng <famz@redhat.com> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170220105139.21581-2-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker/Makefile.include: add a generic docker-run targetAlex Bennée2016-10-171-23/+38
| | | | | | | | | | | | | | | | | | | | | This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example: make docker-run TEST="test-quick" IMAGE="debian:arm64" \ EXECUTABLE=./aarch64-linux-user/qemu-aarch64 The existing docker-foo@bar targets still work but the inline verification has been dropped because we already don't hit that due to other pattern rules in rules.mak. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20161011161625.9070-5-alex.bennee@linaro.org> Message-Id: <20161011161625.9070-6-alex.bennee@linaro.org> [Squash in the verification removal patch. - Fam] Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker: make test-mingw honour TARGET_LISTAlex Bennée2016-10-171-1/+2
| | | | | | | | The other builders honour this variable, so should the mingw build. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20161011161625.9070-4-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker: test-build scriptAlex Bennée2016-10-171-0/+20
| | | | | | | | | | Much like test-quick but only builds. This is useful for some of the build targets like ThreadSanitizer that don't yet pass "make check". Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20161011161625.9070-3-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* tests/docker: add travis dockerfileAlex Bennée2016-10-171-0/+6
| | | | | | | | | | This target grabs the latest Travis containers from their repository at quay.io and then installs QEMU's build dependencies. With this it is possible to run on broadly the same setup as they have on travis-ci.org. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20161011161625.9070-2-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* rules.mak: quiet-command: Split command name and args to printPeter Maydell2016-10-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The quiet-command make rule currently takes two arguments: the command and arguments to run, and a string to print if the V flag is not set (ie we are not being verbose). By convention, the string printed is of the form " NAME some args". Unfortunately to get nicely lined up output all the strings have to agree about what column the arguments should start in, which means that if we add a new quiet-command usage which wants a slightly longer CMD name then we either put up with misalignment or change every quiet-command string. Split the quiet-mode string into two, the "NAME" and the "same args" part, and use printf(1) to format the string automatically. This means we only need to change one place if we want to support a longer maximum name. In particular, we can now print 7-character names lined up properly (they are needed for the OSX "SETTOOL" invocation). Change all the uses of quiet-command to the new syntax. (Any which are missed or inadvertently reintroduced via later merges will result in slightly misformatted quiet output rather than disaster.) A few places in the pc-bios/ makefiles are updated to use "BUILD", "SIGN" and "STRIP" rather than "Building", "Signing" and "Stripping" for consistency and to keep them below 7 characters. Module .mo links now print "LD" rather than the nonstandard "LD -r". Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1475598441-27908-1-git-send-email-peter.maydell@linaro.org
* docker: Build in a clean directoryFam Zheng2016-10-025-0/+11
| | | | | | | | | Currently we configure and build under "$QEMU_SRC/tests/docker" which is dubious. Create a fixed directory (to be friendly to ccache) and change to there before calling build_qemu. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1475047892-11955-1-git-send-email-famz@redhat.com>
* docker: exec $CMDFam Zheng2016-09-231-6/+9
| | | | | | | | | This is the last command to run (unless DEBUG), make it 'exec' to simplify the process tree. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-10-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Terminate instances at SIGTERM and SIGHUPFam Zheng2016-09-231-1/+4
| | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-9-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Support showing environment informationFam Zheng2016-09-232-1/+12
| | | | | | | | | Add a make variable SHOW_ENV. When it's set to non empty, print the package information and environment variables. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-8-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Print used options before doing configureFam Zheng2016-09-231-6/+8
| | | | | | | | | This makes the configure command more obvious which usually has useful information. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-7-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Flatten default target list in test-quickFam Zheng2016-09-231-1/+1
| | | | | | | | | Previously it is expanded to a whitespace separated list which is not the most appropriate format. Since it's only two items, flatten it. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-6-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Update fedora image to latestFam Zheng2016-09-231-1/+1
| | | | | | | | | Now that 23 is becoming an "old" release with 24 available. Fedora has a quick release cycle, so use latest to follow more closely. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-5-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Generate /packages.txt in ubuntu imageFam Zheng2016-09-231-1/+3
| | | | | | | | | Put the list of package names in an environment, and output their package names to the target file in the end. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-4-git-send-email-famz@redhat.com> Reviewed-by: Daniel. P. Berrange <berrange@redhat.com>
* docker: Generate /packages.txt in fedora imageFam Zheng2016-09-231-2/+12
| | | | | | | | | Put the list of package names in an environment, and output their package names to the target file in the end. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-3-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Generate /packages.txt in centos6 imageFam Zheng2016-09-231-2/+4
| | | | | | | | | Put the list of package names in an environment, and output their package names to the target file in the end. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1474429768-25027-2-git-send-email-famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
* docker: Handle exceptions when looking for docker commandEduardo Habkost2016-09-231-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to run docker tests on a host without the docker command, we get the following Python backtrace: $ make docker-test-quick@centos6 V=1 .../qemu/tests/docker/docker.py build qemu:centos6 .../qemu/tests/docker/dockerfiles/centos6.docker Traceback (most recent call last): File ".../qemu/tests/docker/docker.py", line 339, in <module> sys.exit(main()) File ".../qemu/tests/docker/docker.py", line 336, in main return args.cmdobj.run(args, argv) File ".../qemu/tests/docker/docker.py", line 231, in run dkr = Docker() File ".../qemu/tests/docker/docker.py", line 98, in __init__ self._command = _guess_docker_command() File ".../qemu/tests/docker/docker.py", line 41, in _guess_docker_command stdout=DEVNULL, stderr=DEVNULL) == 0: File "/usr/lib64/python2.7/subprocess.py", line 523, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory .../qemu/tests/docker/Makefile.include:47: recipe for target 'docker-image-centos6' failed make: *** [docker-image-centos6] Error 1 Change _guess_docker_command() to handle OSError exceptions raised by subprocess.call(), so we will keep looking for other commands and print a better error message. New output will be: $ make docker-test-quick@centos6 V=1 .../qemu/tests/docker/docker.py build qemu:centos6 .../qemu/tests/docker/dockerfiles/centos6.docker Traceback (most recent call last): File ".../qemu/tests/docker/docker.py", line 343, in <module> sys.exit(main()) File ".../qemu/tests/docker/docker.py", line 340, in main return args.cmdobj.run(args, argv) File ".../qemu/tests/docker/docker.py", line 235, in run dkr = Docker() File ".../qemu/tests/docker/docker.py", line 102, in __init__ self._command = _guess_docker_command() File ".../qemu/tests/docker/docker.py", line 49, in _guess_docker_command commands_txt) Exception: Cannot find working docker command. Tried: docker sudo -n docker .../qemu/tests/docker/Makefile.include:47: recipe for target 'docker-image-centos6' failed make: *** [docker-image-centos6] Error 1 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1474369559-16903-1-git-send-email-ehabkost@redhat.com> [exceptions.OSError -> OSError and drop the import. - Fam] Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: silence debootstrap when --quiet is givenSascha Silbe2016-09-081-1/+2
| | | | | | | | | | | | | If we silence docker when --quiet is given, we should also silence the .pre script (i.e. debootstrap). Only discards stdout, so some diagnostics (e.g. from git clone) are still printed. Most of the verbose output is gone however and this way we still have a chance to see error messages. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-9-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: build debootstrap after cloningSascha Silbe2016-09-081-0/+1
| | | | | | | | | | | When using the git version of debootstrap (because no usable version of debootstrap was installed on the host), we need to run 'make' so that devices.tar.gz gets built. Otherwise the first debootstrap stage will fail without printing any error message. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-8-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: make sure debootstrap is at least 1.0.67Sascha Silbe2016-09-081-0/+10
| | | | | | | | | | | | | debootstrap prior to 1.0.67 generated an empty sources.list during foreign bootstraps (Debian#732255 [1]). Fall back to the git checkout if the installed debootstrap version is too old. [1] https://bugs.debian.org/732255 Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-7-git-send-email-silbe@linux.vnet.ibm.com> [Update 'sort -C' to 'sorc -c &>/dev/null' - Fam] Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: print warning if EXECUTABLE is not set when building debootstrap imageSascha Silbe2016-09-081-0/+3
| | | | | | | | | | Building the debian-debootstrap image will usually fail if EXECUTABLE isn't set (when using the Makefile). Warn the user in this case so they know why it's failing. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-6-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: debian-bootstrap.pre: print helpful message if DEB_ARCH/DEB_TYPE unsetSascha Silbe2016-09-081-0/+13
| | | | | | | | | | | | The debian-bootstrap image doesn't choose a default architecture and distribution version, instead the user has to set both DEB_ARCH and DEB_TYPE in the environment. Print a reasonably helpful message if either of them isn't set instead of complaining about "qemu-" being missing or erroring out because we cannot cd to the mirror URL. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-5-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: debian-bootstrap.pre: print error messages to stderrSascha Silbe2016-09-081-4/+4
| | | | | | | | | Send error messages where they belong so they're seen even if stdout is redirected to /dev/null. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-4-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: avoid dependency on 'realpath' packageSascha Silbe2016-09-081-1/+1
| | | | | | | | | | | | The 'realpath' executable is shipped in a separate package that isn't installed by default on some distros. We already use 'readlink -e' (provided by GNU coreutils) in some other part of the code, so let's settle for that instead. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-Id: <1473192351-601-3-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker.py: don't hang on large docker outputSascha Silbe2016-09-081-3/+6
| | | | | | | | | | | | | | Unlike Popen.communicate(), subprocess.call() doesn't read from the stdout file descriptor. If the child process produces more output than fits into the pipe buffer, it will block indefinitely. If we don't intend to consume the output, just send it straight to /dev/null to avoid this issue. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com> Message-Id: <1473192351-601-2-git-send-email-silbe@linux.vnet.ibm.com> Signed-off-by: Fam Zheng <famz@redhat.com>