~ubuntu-test-case-dev/ubuntu-test-cases/server

« back to all changes in this revision

Viewing changes to scripts/base.sh

  • Committer: Max Brustkern
  • Date: 2012-12-19 21:33:11 UTC
  • Revision ID: max@canonical.com-20121219213311-z0d20vcyo7nfxk0l
Created scripts that point to current server test branch and add needed options for raid1 and ceph tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
usage()
 
2
{
 
3
    cat <<EOF
 
4
usage: $(basename $0) -i IMAGE
 
5
 
 
6
Run server default scenario using default parameters
 
7
 
 
8
options:
 
9
    -h               Show this help and exit
 
10
    -i IMAGE         Path/URL to image to be used
 
11
EOF
 
12
}
 
13
 
 
14
parse_args()
 
15
{
 
16
    while getopts :i: OPTION; do
 
17
        case $OPTION in
 
18
            i)
 
19
                IMAGE=$OPTARG
 
20
                ;;
 
21
            ?)
 
22
                usage
 
23
                exit
 
24
                ;;
 
25
        esac
 
26
    done
 
27
 
 
28
    if [ -z "$IMAGE" ]; then
 
29
        usage
 
30
        exit
 
31
    fi
 
32
 
 
33
    if [ -z "$PRESEED" ]; then
 
34
        echo "PRESEED environment variable not found"
 
35
        exit
 
36
    fi
 
37
 
 
38
    if [ -z "$RUNLIST" ]; then
 
39
        echo "RUNLIST environment variable not found"
 
40
        exit
 
41
    fi
 
42
 
 
43
    if [ -z "$BOOT_ARGS" ]; then
 
44
        CMD="run_utah_tests.py -i $IMAGE -p $PRESEED $RUNLIST"
 
45
    else
 
46
        CMD="run_utah_tests.py -i $IMAGE -p $PRESEED -b $BOOT_ARGS $RUNLIST"
 
47
    fi
 
48
}