#!/usr/bin/env -S bats --report-formatter junit --formatter tap
# -*-sh-*-

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

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

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

setup() {
    if [ -n "$SIMPLE_CI" ]; then
        skip "Not supported in simple CI setup"
    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" ]

}

