aboutsummaryrefslogtreecommitdiff
path: root/examples/execute_installtest.sh
blob: c574e769d79b884c8277ad0ab9d058d699054858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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
echo '$Id$'
INSTALLTESTPID=$$
( sleep 1h ; kill $INSTALLTESTPID ) &
KILLPID=$!

apt-get install -y --force-yes "$@" < /dev/null

kill $KILLPID