Simplify autorelease to not use release tags
[releng/builder.git] / jjb / packaging / include-raw-test-karaf.expect
1 #!/usr/bin/expect
2 # This script starts the karaf shell and sends the password for SSH auth.
3 # Further tests in karaf shell can be done here
4
5 # Echo commands
6 log_user 1
7
8 # Default password
9 set password "karaf"
10 # Default prompt
11 set prompt "opendaylight-user@root>"
12
13 # OpenDaylight service requires some time after it starts for a successful
14 # SSH connection
15 sleep 10
16
17 # SSH into Karaf shell
18 spawn ssh -p 8101 -o StrictHostKeyChecking=no karaf@127.0.0.1
19 expect "Password authentication"
20 expect "Password: "
21 send "$password\r"
22
23 # Verify expected features
24 expect "$prompt"
25 send "feature:list | grep odl-netvirt-openstack\r"
26 expect {{
27   timeout {{
28     send_user "\nTest feature not found"
29     exit 1
30   }}
31   "OpenDaylight :: NetVirt :: OpenStack" {{
32     send_user "\nTest feature available"
33   }}
34 }}
35
36 # Install feature
37 send "feature:install odl-netvirt-openstack\r"
38 expect {{
39   "Error executing command: Can't install feature" {{
40     send_user "\nFailed to install test feature"
41     exit 1
42   }}
43 }}
44
45 # Verify installed feature is actually installed
46 expect "$prompt"
47 send "feature:list | grep odl-netvirt-openstack\r"
48 expect {{
49   timeout {{
50     send_user "\nTest feature not installed\n"
51     exit 1
52   }}
53   " x " {{
54     send_user "\nTest feature installed successfully\n"
55   }}
56 }}
57
58 # TODO Add further tests here