Merge "Fix Java related issues"
[releng/builder.git] / jenkins-scripts / mininet.sh
1 #!/bin/bash
2
3 # make sure we don't require tty for sudo operations
4 cat <<EOF >/etc/sudoers.d/89-jenkins-user-defaults
5 Defaults:jenkins !requiretty
6 jenkins     ALL = NOPASSWD: ALL
7 EOF
8
9 # for whatever reason netopeer & CPqD aren't installed (they weren't in
10 # one of the yum repos we were hooked up to when the base image was
11 # built, they are now. Make sure they're install
12 yum install -q -y netopeer-server-sl CPqD-ofsoftswitch13 
13
14 # installing sshuttle to create a VPN-ish proxy to VMs that have
15 # docker containers on them in order to make them externally accessible
16 yum install -q -y sshuttle
17
18 # netaddr and ipaddress libraries can be useful on this system as
19 # some tests are starting to push pyhon scripts/tools to this VM
20 # during CI tests
21 yum install -q -y python-{ipaddr,iptools,netaddr}
22
23 #For executing the CSIT test cases for VTN Coordinator
24 yum install -q -y uuid libxslt libcurl unixODBC json-c
25 chown jenkins /usr/local/vtn
26
27
28 # the vagrant configuration for netopeer doesn't configure SSH correctly
29 # as it uses and here document via echo and not cat fix that
30 cat << EOSSH >> /etc/ssh/sshd_config
31
32 # Added for netconf / netopeer testing
33 Port 22
34 Port 830
35 Subsystem netconf /usr/bin/netopeer-server-sl
36 EOSSH
37
38 # Configuring sshd to accept root login with password
39 sed -ie 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
40 sed -ie 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
41 chattr +i /etc/ssh/sshd_config
42
43 # sshd has to get a restart because of the above
44 service sshd restart
45
46 # found out while doing testing to fix netopeer that the selinux perms
47 # aren't set correctly (thanks Rackspace for having an EL6 image that
48 # didn't have selinux on at first!) fix it so that the password can be
49 # set
50 /sbin/restorecon -R /etc
51
52 # According to Luis in RT7956 the controller SSH capabilities require
53 # that for NETCONF it uses a password (how broken!) So we're going to
54 # force a password onto the jenkins user
55 echo 'jenkins' | passwd -f --stdin jenkins
56
57 # netopeer doesn't work correctly for non-root users from what I'm
58 # seeing (at least for the initial connection). Let's allow the tests to
59 # get in as the root user since jenkins already has full sudo
60 echo 'root' | passwd -f --stdin root
61
62 # make sure the firewall is stopped
63 /bin/bash disable_firewall.sh
64
65 # vim: sw=2 ts=2 sts=2 et :