Merge "Added TSDR System test jenkin jobs"
[releng/builder.git] / jenkins-scripts / mininet.sh
index ec17a578afb2387492740309113481e6703b63b4..7f7a20e6f5e1b5f38d8e53d1209121afedeb6b33 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+# make sure we don't require tty for sudo operations
+cat <<EOF >/etc/sudoers.d/89-jenkins-user-defaults
+Defaults:jenkins !requiretty
+jenkins     ALL = NOPASSWD: ALL
+EOF
+
 # for whatever reason netopeer & CPqD aren't installed (they weren't in
 # one of the yum repos we were hooked up to when the base image was
 # built, they are now. Make sure they're install
@@ -15,6 +21,11 @@ Port 830
 Subsystem netconf /usr/bin/netopeer-server-sl
 EOSSH
 
+# Configuring sshd to accept root login with password
+sed -ie 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
+sed -ie 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
+chattr +i /etc/ssh/sshd_config
+
 # sshd has to get a restart because of the above
 service sshd restart
 
@@ -29,6 +40,11 @@ service sshd restart
 # force a password onto the jenkins user
 echo 'jenkins' | passwd -f --stdin jenkins
 
+# netopeer doesn't work correctly for non-root users from what I'm
+# seeing (at least for the initial connection). Let's allow the tests to
+# get in as the root user since jenkins already has full sudo
+echo 'root' | passwd -f --stdin root
+
 # make sure the firewall is stopped
 service iptables stop