summaryrefslogtreecommitdiffstats
path: root/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-06-11 14:22:02 +0300
committerMichael Lando <ml636r@att.com>2017-06-11 17:48:32 +0300
commitb3d4898d9e8452ea0b8d848c048e712d43b8d9a3 (patch)
tree0609319203be13f6c29ccbe24cb39c9d64f90095 /test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
parentaf9929df75604ce407d0ca542b200630164e0ae6 (diff)
[SDC-29] rebase continue work to align source
Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh')
-rw-r--r--test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh b/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
new file mode 100644
index 0000000000..30094fe235
--- /dev/null
+++ b/test-apis-ci/src/main/resources/ci/scripts/copyToStorage.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+REPORT_NAME=$1
+VERSION=$2
+ENV=$3
+IP=$4
+
+if [ -z "$REPORT_NAME" ]
+ then
+ source ExtentReport/versions.info
+ now=$(date -d '+7 hour' "+%Y-%m-%d_%H_%M")
+ REPORT_NAME="${now}"
+ VERSION="${osVersion}"
+ if [[ $env == *"DEV20"* ]]
+ then
+ ENV="Nightly"
+ else
+ ENV=""
+ fi
+
+ fi
+
+/usr/bin/expect << EOF
+spawn ssh admin@${IP} mkdir -p -m 775 /home/admin/reports/${ENV}/${VERSION}/APIs/
+
+expect {
+ -re ".*es.*o.*" {
+ exp_send "yes\r"
+ exp_continue
+ }
+ -re ".*sword.*" {
+ exp_send "Aa123456\r"
+ }
+}
+
+expect eof
+
+spawn scp -r ExtentReport admin@${IP}:/home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
+
+expect {
+ -re ".*es.*o.*" {
+ exp_send "yes\r"
+ exp_continue
+ }
+ -re ".*sword.*" {
+ exp_send "Aa123456\r"
+ }
+}
+
+expect eof
+
+spawn ssh admin@${IP} chmod -R 775 /home/admin/reports/${ENV}/${VERSION}/APIs/${REPORT_NAME}/
+
+expect {
+ -re ".*es.*o.*" {
+ exp_send "yes\r"
+ exp_continue
+ }
+ -re ".*sword.*" {
+ exp_send "Aa123456\r"
+ }
+}
+
+expect eof
+
+EOF