Modify interactions with installer VM to set up jenkins-ci for cbench test 21/32321/3
authorJamo Luhrsen <jluhrsen@redhat.com>
Wed, 29 Mar 2017 22:53:52 +0000 (15:53 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Thu, 30 Mar 2017 03:38:18 +0000 (20:38 -0700)
- was grabbing stackrc for SDN_CONTROLLER_IP, but it actually in overcloudrc
- need to skip hostkeychecking for scp operations
- change permissions and ownership of /tmp/.ssh/ files so jenkins-ci can
  take over as the user

Change-Id: I2d8f3aadfd6eff35a288a4e49eabb035bb2560ef
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
jjb/cperf/cperf-ci-jobs.yml

index 2742f08..6cd4e22 100644 (file)
             undercloud_mac=$(sudo virsh domiflist undercloud | grep default | \
                               grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
             INSTALLER_IP=$(/usr/sbin/arp -e | grep ${undercloud_mac} | awk {'print $1'})
-            sudo scp $INSTALLER_IP:/home/stack/stackrc /tmp/stackrc
-            source /tmp/stackrc
+            sudo scp -o StrictHostKeyChecking=no root@$INSTALLER_IP:/home/stack/overcloudrc /tmp/overcloudrc
+            sudo chmod 755 /tmp/overcloudrc
+            source /tmp/overcloudrc
 
             # robot suites need the ssh key to log in to controller nodes, so throwing it
             # in tmp, and mounting /tmp as $HOME as far as robot is concerned
             sudo mkdir -p /tmp/.ssh
-            sudo scp $INSTALLER_IP:/home/stack/.ssh/id_rsa /tmp/.ssh/
-            sudo chmod -R 0600 /tmp/.ssh
+            sudo scp -o StrictHostKeyChecking=no root@$INSTALLER_IP:/home/stack/.ssh/id_rsa /tmp/.ssh/
+            sudo chown -R jenkins-ci:jenkins-ci /tmp/.ssh
+            # done with sudo. jenkins-ci is the user from this point
+            sudo mv /tmp/.ssh/id_rsa ~jenkins-ci/.ssh/
+            chmod -R 0600 ~jenkins-ci/.ssh
 
             # cbench requires the openflow drop test feature to be installed.
             sshpass -p karaf ssh -o StrictHostKeyChecking=no \