aboutsummaryrefslogtreecommitdiff
path: root/examples/execute_installtest.sh
blob: 2e903a794d9505c8a6f5243702c1ecb059ba5d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# pbuilder example script.
# Copyright 2003, 2007 Junichi Uekawa
#Distributed under GPL version 2 or later

#before running this script, make sure you have an up-to-date system
#with pbuilder update.

# This will install a package using APT inside the chroot and see if
# that fails. If it fails, it's wrong.

set -ex

# practically, killing is not enough, do a reboot here instead.
echo 'nobody@nowhere' > /etc/mailname
INSTALLTESTPID=$$
( sleep 1h ; kill $INSTALLTESTPID ) &
KILLPID=$!

apt-get install -y "${APTGETOPT[@]}" "$@" < /dev/null

kill $KILLPID