aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/files/run-ptest
blob: e985544978a8488b4da8fdbc9102a252b62d1a1f (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
#!/bin/bash

# Network interfaces come up and down and can be quite noisy
# and since we are often on the console when running ptests
# let's just quiet things some
dmesg -n 1

# Blacklisted test will be skipped
blacklist=""
# Not applicable
blacklist="$blacklist lxc-test-apparmor"
# These currently hang so skip them until someone fixes them up
blacklist="$blacklist lxc-test-shutdowntest"
blacklist="$blacklist lxc-test-state-server"

passed=0
failed=0
skipped=0

# Create logs dir and clear old logs if any
mkdir logs 2> /dev/null
rm -f logs/*

echo "### Starting LXC ptest ###"

for test in ./tests/*
do
    if [[ ! $blacklist = *$(basename $test)*  ]]
    then
	$test >logs/$(basename $test).log 2>&1
    else
	echo "$test SKIPPED"
	skipped=$((skipped+1))
	continue
    fi

    if [ $? -eq 0 ]
    then
	echo "$test PASS"
	passed=$((passed+1))
    else
	echo "$test FAIL"
	failed=$((failed+1))
    fi
done

echo ""
echo "Results:"
echo "    PASSED = $passed"
echo "    FAILED = $failed"
echo "    SKIPPED = $skipped"
echo "(for details check individual test log in ./logs directory)"
echo ""
echo "### LXC ptest complete ###"

# restore dmesg to console
dmesg -n 6