#!/bin/bash # # Integration test for remote file IO of file node-type. # # @author Steffen Vogel # @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC # @license GNU General Public License (version 3) # # VILLASnode # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ################################################################################## SCRIPT=$(realpath $0) SCRIPTPATH=$(dirname ${SCRIPT}) source ${SCRIPTPATH}/../../tools/villas-helper.sh CONFIG_FILE=$(mktemp) INPUT_FILE=$(mktemp) OUTPUT_FILE=$(mktemp) NUM_SAMPLES=${NUM_SAMPLES:-10} URI=https://Q9ZHPBD5eRlZcAi:badpass@rwth-aachen.sciebo.de/public.php/webdav/tests/pipe # WebDav / OwnCloud / Sciebo do not support partial upload # So we do not flush the output cat > ${CONFIG_FILE} < /dev/null # Generate test data VILLAS_LOG_PREFIX=$(colorize "[Signal] ") \ villas-signal -n -l ${NUM_SAMPLES} random > ${INPUT_FILE} # Upload data to cloud VILLAS_LOG_PREFIX=$(colorize "[Send] ") \ villas-pipe -s ${CONFIG_FILE} remote_file < ${INPUT_FILE} # Download data from the cloud VILLAS_LOG_PREFIX=$(colorize "[Recv] ") \ villas-pipe -r -l ${NUM_SAMPLES} ${CONFIG_FILE} remote_file > ${OUTPUT_FILE} # Compare results villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE} RC=$? rm -f ${CONFIG_FILE} ${INPUT_FILE} ${OUTPUT_FILE} exit ${RC}