# HACK For debug
#cd /home/koraty/Documenti/master_thesis/vagrant/

# INFO Running on host #
source logging.sh
source variables.sh

if [ "$VAGRANT_TESTS" = false ] ; then
  log $DEBUG_LEVEL $VERBOSE_INFO "Vagrant tests not activated , skipping ..."
  exit 0
fi

# DESCRIPTION #
log $DEBUG_LEVEL $VERBOSE_INFO "Testing SSH connection from both sides..."

# HERE Put final tests to run on the host #
# Test SSH connection from host to VM
common/tests/test_ssh_host_to_VM.sh
# Loop through each node in $NODES and test SSH connection from each VM back to the host

#DRAFT#
# for node in "${NODES[@]}"; do
#     log $DEBUG_LEVEL $VERBOSE_DEBUG "Testing SSH connection from $node to host..."
    
#     # HERE Put final tests to run in each VM #
#     # Attempt SSH connection and log if it fails
#     if ! ssh root@"$node" 'bash -s' < common/tests/test_ssh_VM_to_host.sh; then
#         log $DEBUG_LEVEL $VERBOSE_ERROR "SSH connection failed for $node. Continuing to next node."
#     fi
# done
