Added Gitlab CI test

This commit is contained in:
Deon George 2016-06-23 21:29:18 +10:00
parent a8b6d48a1a
commit b583b9e87e
3 changed files with 76 additions and 2 deletions

View File

@ -1,5 +1,10 @@
# Compmile on CentOS 6.x, for some reason compiling on CentOS 7.x results in buffer corruption # Compile on CentOS 6.x, for some reason compiling on CentOS 7.x results in buffer corruption
test:6-7.1: stages:
- build
- test
test:6-7.1:build:
stage: build
image: leenooks/ci-tsm:6-7.1 image: leenooks/ci-tsm:6-7.1
script: script:
- make -f Makefile.linux64 - make -f Makefile.linux64
@ -7,3 +12,13 @@ test:6-7.1:
- master - master
tags: tags:
- C - C
test:6-7.1:test:
stage: test
image: leenooks/ci-tsm:6-7.1
script:
- cd test && ./test.sh
only:
- master
tags:
- C

18
test/dsm.sys Normal file
View File

@ -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

41
test/test.sh Executable file
View File

@ -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