aboutsummaryrefslogtreecommitdiff
path: root/testsuite/run-test-uml.sh
blob: e80e24666b3340aca906b56502ede6d558ff6c43 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
# This is a testsuite.
# estimated run-time on my PC; 45 minutes.

PBUILDER_UML=/usr/bin/pbuilder-user-mode-linux

RESULTFILE="run-test-uml.log"
: > ${RESULTFILE}
RESULTFILE=$(readlink -f ${RESULTFILE})
log_success () {
    CODE=$?
    if [ $CODE = 0 ]; then
	echo "[OK]   $1" >> ${RESULTFILE}
    else
	echo "[FAIL] $1" >> ${RESULTFILE}
    fi
}


sudo ifconfig eth0:tst 192.168.30.62 netmask 255.255.255.0
tcpproxy 8081 ring.asahi-net.or.jp 80 &
TCPPROXY=$!

pbuilder-user-mode-linux test --configfile non-existing-configfile

if [ -x "${PBUILDER_UML}" ]; then
    for distribution in sid sarge; do
	pbuilder-user-mode-linux create --mirror  http://192.168.30.198/archives/linux/debian/debian --distribution "${distribution}" --uml-image $(pwd)/testimage --logfile uml/pbuilder-user-mode-linux-create-${distribution}.log
	log_success create-${distribution}

	for PKG in dsh; do 
	    ( 
		mkdir testbuild
		cd testbuild
		apt-get source -d ${PKG}
	    )
	    pbuilder-user-mode-linux build --uml-image $(pwd)/testimage --buildplace $(pwd)/testbuild/ --logfile uml/pbuilder-user-mode-linux-build-${PKG}-${distribution}.log testbuild/${PKG}*.dsc
	    log_success build-${distribution}-${PKG}

	    (
		mkdir testbuild2
		cd testbuild2
		apt-get source ${PKG}
		cd ${PKG}-*
		pdebuild-user-mode-linux --logfile ../../uml/pdebuild-user-mode-linux-normal-${distribution}.log -- --uml-image $(pwd)/../../testimage --buildplace $(pwd)/../../testbuild2/
		log_success pdebuild-${distribution}-${PKG}

		pdebuild-user-mode-linux --use-pdebuild-internal --logfile ../../uml/pdebuild-user-mode-linux-internal-${distribution}.log -- --uml-image $(pwd)/../../testimage --buildplace $(pwd)/../../testbuild2/
		log_success pdebuild-internal-${distribution}-${PKG}
	    )
	done
	pbuilder-user-mode-linux execute --uml-image $(pwd)/testimage --logfile uml/pbuilder-user-mode-linux-execute-${distribution}.log ../examples/execute_paramtest.sh test1 test2 test3
	log_success execute-${distribution}

	rm -rf testbuild testbuild2 testimage
    done
fi

kill ${TCPPROXY}