diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5dafed7..713f4c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,10 @@ -# Compmile on CentOS 6.x, for some reason compiling on CentOS 7.x results in buffer corruption -test:6-7.1: +# Compile on CentOS 6.x, for some reason compiling on CentOS 7.x results in buffer corruption +stages: + - build + - test + +test:6-7.1:build: + stage: build image: leenooks/ci-tsm:6-7.1 script: - make -f Makefile.linux64 @@ -7,3 +12,13 @@ test:6-7.1: - master tags: - C + +test:6-7.1:test: + stage: test + image: leenooks/ci-tsm:6-7.1 + script: + - cd test && ./test.sh + only: + - master + tags: + - C diff --git a/test/dsm.sys b/test/dsm.sys new file mode 100644 index 0000000..3ea8be5 --- /dev/null +++ b/test/dsm.sys @@ -0,0 +1,18 @@ +DEFAULTServer test +SErvername test + COMMmethod TCPip + MANAGEDServices schedule + TCPPort 1500 + TCPServeraddress tsm.leenooks.vpn + PASSWORDAccess generate + SCHEDMode polling + + ERRORLOGRetention 10,d + ERRORLOGName /tmp/dsmerror.log + SCHEDLOGName /tmp/dsmsched.log + SCHEDLOGRetention 10,d + + TCPNodelay Yes + TCPBuffsize 32 + TCPWindowsize 64 + SSL No diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..1eafbc3 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +FILE=random.1m + +# Create TEST File +MD5=$(dd if=/dev/urandom bs=1024 count=1024 2>/dev/null |tee ${FILE} |md5sum |awk '{print $1}') +SIZE=$(ls -l ${FILE}|awk '{print $5}') + +TSMPIPE=../tsmpipe + +echo "MD5 of [${FILE}] is [${MD5}] (${SIZE})" + +ln -s /opt/tivoli/tsm/client/api/bin64/EN_US +export DSMI_DIR=./ + +# Send file to TSM +echo "+ TEST SEND FILE!" +cat ${FILE} | ${TSMPIPE} -Bcm MD5 -s /test -f ${FILE} -vvv -l ${SIZE} -O"-VIRTUALNODENAME=TEST -PASSWORD=TEST" + +# Send a second time +echo "+ TEST SEND FILE AGAIN!" +cat ${FILE} | ${TSMPIPE} -Bcm MD5 -s /test -f ${FILE} -vvv -l ${SIZE} -O"-VIRTUALNODENAME=TEST -PASSWORD=TEST" + +# List it +echo "+ TEST LIST FILE!" +${TSMPIPE} -Bts /test -f ${FILE} -vvv -O"-VIRTUALNODENAME=TEST -PASSWORD=TEST" + +# Get it back +echo "+ TEST RETRIEVE FILE!" +${TSMPIPE} -Bxs /test -f ${FILE} -vvv -O"-VIRTUALNODENAME=TEST -PASSWORD=TEST" > ${FILE}.back +RETRIEVE=$(md5sum ${FILE}.back | awk '{print $1}') +if [ "${MD5}" != "${RETRIEVE}" ]; then + exit 1 +else + echo "+ RETRIEVE VALID!" +fi + +# Delete it +echo "+ TEST DELETE!" +./${TSMPIPE} -Bds /test -f ${FILE} -vvv -O"-VIRTUALNODENAME=TEST -PASSWORD=TEST" + +rm -f EN_US ${FILE} ${FILE}.back