18c34900aaeaf4a0e4276a87044ea7aa910bb03e
[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 # the vagrant configuration for netopeer doesn't configure SSH correctly
15 # as it uses and here document via echo and not cat fix that
16 cat << EOSSH >> /etc/ssh/sshd_config
17
18 # Added for netconf / netopeer testing
19 Port 22
20 Port 830
21 Subsystem netconf /usr/bin/netopeer-server-sl
22 EOSSH
23
24 # sshd has to get a restart because of the above
25 service sshd restart
26
27 # found out while doing testing to fix netopeer that the selinux perms
28 # aren't set correctly (thanks Rackspace for having an EL6 image that
29 # didn't have selinux on at first!) fix it so that the password can be
30 # set
31 /sbin/restorecon -R /etc
32
33 # According to Luis in RT7956 the controller SSH capabilities require
34 # that for NETCONF it uses a password (how broken!) So we're going to
35 # force a password onto the jenkins user
36 echo 'jenkins' | passwd -f --stdin jenkins
37
38 # make sure the firewall is stopped
39 service iptables stop
40
41 # vim: sw=2 ts=2 sts=2 et :