#!/usr/bin/bash
########################################################################
#  Project Magpie. For details, see https://github.com/llnl/magpie.
#
#  Copyright (C) 2020 Intel Corporation. All rights reserved.
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License version
#  2 as published by the Free Software Foundation.
#
#  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.
#
#  Aleksander Kantak <aleksander.kantak@intel.com>
########################################################################

# This script is for running the alluxio testalluxio sanity test. For
# the most part, it shouldn't be editted. See job submission files
# for configuration details.

source ${MAGPIE_SCRIPTS_HOME}/magpie/lib/magpie-lib-paths

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs ls /"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs copyFromLocal ${ALLUXIO_HOME}/LICENSE /LICENSE"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs ls /"
echo "Running $command" >&2
$command

# 157 bytes is the license header length
command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs head -c 157 /LICENSE"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs persist /LICENSE"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs ls /"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs rm /LICENSE"
echo "Running $command" >&2
$command

command="${ALLUXIO_HOME}/${alluxiocmdprefix}/alluxio fs ls /"
echo "Running $command" >&2
$command

exit 0
