Files
mc/tests/tests/config-host-test.sh
T

33 lines
955 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Testing mc config hosts
# 1. Get number of previous hosts
# 2. Add a host
# 3. Assert the increase in number of hosts by one.
# 4. Delete the new host
initial_count=`mc config host list | wc -l`
add_test_result=`mc config --json host add testdisk https://storage.googleapis.com BKIKJAA5BMMU2RHO6IBB V8f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v2`
final_count=`mc config host list | wc -l`
remove_test_result=`mc config host remove testdisk`
if [ "$add_test_result" == "Added ‘testdisk’ successfully." ]; then
echo "mc config host add Test Passed";
else
echo "mc config host add Test Failed";
fi
if [ $((initial_count + 1)) -ne $final_count ]; then
echo "mc config host list Test Failed";
else
echo "mc config host list Test Passed";
fi
if [ "$remove_test_result" == "Removed ‘testdisk’ successfully." ]; then
echo "mc config host remove Test Passed";
else
echo "mc config host remove Test Failed";
fi