Fixup tempdir creation

Change-Id: I6743c08d9423ab8cdbb88335bbf30811aa484168
Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy
index 005232b..aef40c1 100644
--- a/jenkins/ci-pipelines/ci_stage_3.groovy
+++ b/jenkins/ci-pipelines/ci_stage_3.groovy
@@ -50,11 +50,9 @@
 }
 
 def run_systest(stackName,tagName,testName) {
-    sh """
-        tempdir=$(mktemp -d)
-        docker run -ti --network net${stackName} -v $tempdir:/usr/share/osm-devops/systest/reports osm/osmclient:${tagName} make -C /usr/share/osm-devops/systest ${testName}
-        cp $tempdir/*.xml .
-       """
+    tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
+    sh "docker run -ti --network net${stackName} -v ${tempdir}:/usr/share/osm-devops/systest/reports osm/osmclient:${tagName} make -C /usr/share/osm-devops/systest ${testName}"
+    cp "${tempdir}/*.xml ."
     junit  '*.xml'
 }