#!../common/bats/bin/bats
# -*-sh-*-

load ../common/test_helper_functions
source ../common/functions || exit 1

if [ -s ./common/TEST_ENV ];then
    source ./common/TEST_ENV
fi

if [ ! -z "$SIMPLE_CI" ]; then
	skip "Not supported in simple CI setup"
fi

if [ -n "$IPMI_PASSWORD" ];then
    export IPMI_PASSWORD
fi

@test "[warewulf-ipmi] ipmitool lanplus protocol" {
    rpm -q --quiet warewulf-ipmi-ohpc || skip "Warewulf not installed, skipping warewulf-ipmitool check"

    run wwsh ipmi powerstatus c1
    [ "${lines[4]}" = "WARNING:  PROTO: lanplus" ]

}

