Skip to content

Commit

Permalink
Consolidate basic-gluster-duffy script
Browse files Browse the repository at this point in the history
Signed-off-by: Rakshitha Kamath <[email protected]>
  • Loading branch information
rakshithakamath94 committed Jul 6, 2023
1 parent 5b7bf1a commit 5d6dcb1
Show file tree
Hide file tree
Showing 28 changed files with 95 additions and 502 deletions.
48 changes: 0 additions & 48 deletions build_scripts/code-compilation/basic-gluster-duffy.sh

This file was deleted.

64 changes: 64 additions & 0 deletions build_scripts/common/basic-server-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

function server_run()
{
if [ "$JOB_NAME" == "iozone-vfs" ] || [ "$JOB_NAME" == "iozone-vfs-minmdcache" ]; then
VOLUME_TYPE="VFS"
else
VOLUME_TYPE="GLUSTER"
fi

if [ "$JOB_NAME" == "pynfs-acl" ]; then
INCLUDE_ACL_PARAM=" ENABLE_ACL='${ENABLE_ACL}'"
fi

scp ${SSH_OPTIONS} ${2} root@${1}:./$(basename ${2})

ssh -t ${SSH_OPTIONS} root@${1} "GERRIT_HOST='${GERRIT_HOST}' GERRIT_PROJECT='${GERRIT_PROJECT}' GERRIT_REFSPEC='${GERRIT_REFSPEC}' CENTOS_VERSION='${CENTOS_VERSION}' CENTOS_ARCH='${CENTOS_ARCH}' ${VOLUME_TYPE}_VOLUME='${EXPORT}' YUM_REPO='${YUM_REPO}' ${INCLUDE_TEMPLATE_URL} ${INCLUDE_ACL_PARAM} bash ./$(basename ${2})"
RETURN_CODE=$?

return $RETURN_CODE
}

function client_run()
{
scp ${SSH_OPTIONS} ${2} root@${1}:./$(basename ${2})

if [ "${JOB_NAME}" == "pynfs" ] || [ "${JOB_NAME}" == "pynfs-acl" ]; then
INCLUDE_TEST_PARAMS="TEST_PARAMETERS='${TEST_PARAMETERS}'"
fi

ssh -t ${SSH_OPTIONS} root@${1} "SERVER='${3}' EXPORT='/${EXPORT}' CENTOS_VERSION='${CENTOS_VERSION}' ${INCLUDE_TEST_PARAMS} bash ./$(basename ${2})"
RETURN_CODE_CLIENT=$?

return $RETURN_CODE_CLIENT
}

SSH_OPTIONS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
SERVER_IP=$(cat $WORKSPACE/hosts | sed -n '1p')

if [ "${TEST_SCRIPT}" ]; then
if [ "${TEMPLATES_URL}" ]; then
TEMPLATES_FOLDER=$(basename ${TEMPLATES_URL})
#Copy the private key to the Server and Give appropriate permission to the file
scp ${SSH_OPTIONS} /duffy-ssh-key/ssh-privatekey root@${SERVER_IP}:./ssh-private-key
ssh -t ${SSH_OPTIONS} root@${SERVER_IP} 'chmod 0600 ~/ssh-private-key'
scp ${SSH_OPTIONS} -r ${TEMPLATES_URL} root@${SERVER_IP}:
INCLUDE_TEMPLATE_URL="TEMPLATES_URL='/root/${TEMPLATES_FOLDER}'"
fi
server_run ${SERVER_IP} ${TEST_SCRIPT}
FINAL_RESULT=$?
elif [ "${SERVER_TEST_SCRIPT}" ] && [ "${CLIENT_TEST_SCRIPT}" ]; then
CLIENT_IP=$(cat $WORKSPACE/hosts | sed -n '2p')
server_run ${SERVER_IP} ${SERVER_TEST_SCRIPT}
SERVER_SCRIPT_RESULT=$?
if [ "${SERVER_SCRIPT_RESULT}" == "0" ]; then
echo "Server script success!"
client_run ${CLIENT_IP} ${CLIENT_TEST_SCRIPT} ${SERVER_IP}
FINAL_RESULT=$?
else
FINAL_RESULT=${SERVER_SCRIPT_RESULT}
fi
fi

exit ${FINAL_RESULT}
50 changes: 0 additions & 50 deletions build_scripts/cthon04/basic-gluster-duffy.sh

This file was deleted.

60 changes: 0 additions & 60 deletions build_scripts/dbench/basic-gluster-duffy.sh

This file was deleted.

31 changes: 0 additions & 31 deletions build_scripts/ganesha-build/basic-gluster-duffy.sh

This file was deleted.

1 change: 1 addition & 0 deletions build_scripts/ganesha-build/build-ganesha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

artifact()
{
rm -rf ${RESULTDIR}/*.log
[ -e ~/ssh-private-key ] || return 0
scp -q -o StrictHostKeyChecking=no -i ~/ssh-private-key -r "${@}" [email protected]:/srv/artifacts/nfs-ganesha/
}
Expand Down
58 changes: 0 additions & 58 deletions build_scripts/iozone/basic-gluster-duffy.sh

This file was deleted.

31 changes: 0 additions & 31 deletions build_scripts/libntirpc-build/basic-gluster-duffy.sh

This file was deleted.

Loading

0 comments on commit 5d6dcb1

Please sign in to comment.