---
# System prepended metadata

title: Untitled

---

```
 stage('Executing Load Tester'){
            steps {
                script {
                withCredentials([string(credentialsId: 'ubuntu-5G-LT', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
                   sh ''' 
                    set -x
                    LT1_VM=10.242.20.224
                    LT1_WORKSPACE="/home/jenkins/workspace"
                    PRODUCT_FOLDER="autoloadtester/ecx-pack"
                    TEST_SCRIPT_FOLDER="ecx-pack5g_LT_1000"

                    RELEASE_GCC83_EL7_TRANSIT_DIR="/home/jenkins/Transit/5GC"
                    BINARY_5GC="${RELEASE_GCC83_EL7_TRANSIT_DIR}/gcc83_el7/main"
                    VER_FILE="${RELEASE_GCC83_EL7_TRANSIT_DIR}/gcc83_el7/version.go"

                    # Collapsed system 5GC
                    UUT_5GC=10.242.210.34

                    # func_stop_copy_restart_bin 
                    #	arg1 IP Address Of remote binary install
                    #	arg2 system Name
                    #	arg3 "main"
                    func_stop_copy_restart_bin ()
                    {
	                # Check arg3 for "main" and call the appropriate stop & restart script
                    if test "$3" = "main"; then
                    echo "${2}: Stop the binary ${1}"
                    sudo apt-get update -y 
                    sudo apt-get install -y sshpass
                    set +e
                    sshpass -p ${PASSWORD} ssh -vtt ${USERNAME}@${1}  sudo systemctl stop main
                    true
                    # ssh -tt cpuser@${1} --non-interactive --username cpuser --password S0ftC0re sudo systemctl stop main 
                    echo "${2}: Update binary"
                    scp -p ${BINARY_5GC} ${USERNAME}@${1}:/usr/pcn4g5g
    
                    echo "${2}: Copying version file"
                    scp -p ${VER_FILE} ${USERNAME}@${1}:/usr/pcn4g5g
                    echo "-------------------- "
                    echo "5GC Version info"
                    echo "-------------------- "