~ubuntu-x-swat/xorg-server/xsmoke

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
#!/bin/bash

. $(dirname $0)/lib/xsmoke.lib

if [ $1 = "prerequisites" ] ; then
    is_installed "dexconf" "run basic xorg test" || exit 1
    exit 0
fi

# Back up the current configuration
cp "$DEFAULT_XORG_CONF" "$DEFAULT_XORG_CONF.orig"
if [ $? != 0 ]; then
    die "Could not backup xorg.conf"
fi

# Check syntax of various scripts and programs
test_syntax_bash "/usr/bin/dexconf"

# Verify Xorg restarts correctly as currently configured
test_xorg_restart

# Generate a new xorg.conf file and test it
test_xorg_conf_creation

# Verify Xorg restarts correctly with new configuration
test_xorg_restart

# Restore original xorg.conf
if [ -f "$DEFAULT_XORG_CONF.orig" ]; then
    mv "$DEFAULT_XORG_CONF.orig" "$DEFAULT_XORG_CONF"
fi

# Verify Xorg restarts correctly as currently configured
test_xorg_restart

echo "Completed all tests"
if [ "${1%.json}" != "$1" ] ; then
    JSON=$1
    json_test_summary > $JSON
fi

print_test_summary