1ebe85531cd2f33a7762b14ffeaa07986101a28e
[releng/builder.git] / jjb / packaging / include-raw-test-rpm.sh
1 #!/bin/bash
2
3 # Options:
4 #   -x: Echo commands
5 #   -e: Fail on errors
6 #   -o pipefail: Fail on errors in scripts this calls, give stacktrace
7 set -ex -o pipefail
8
9 # Remove opendaylight if already installed
10 if rpm -q opendaylight > /dev/null;
11 then
12   sudo yum remove -y opendaylight;
13 fi
14
15 # Install ODL from .rpm link or .repo url
16 if [[ $URL == *.rpm ]]
17 then
18   sudo yum install -y "$URL"
19 elif [[ $URL == *.repo ]]
20 then
21   sudo curl --silent -o "$REPO_FILE" "$URL"
22   sudo yum install -y opendaylight
23 else
24   echo "URL is not a link to .rpm or .repo"
25 fi
26
27 # Install expect to interact with karaf shell
28 sudo yum install -y expect
29
30 # Start OpenDaylight
31 sudo systemctl start opendaylight
32
33 # Check status of OpenDaylight
34 sudo systemctl status opendaylight
35
36 # Get process id of Java
37 pgrep java