summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-08-26 08:06:09 +0200
committerMartin Styk <mastyk@redhat.com>2019-08-26 08:06:09 +0200
commitdbeb89a39ca52e27df2605ca5018cfdc302e7250 (patch)
tree005eef2990fc1179966f8fd54f29fc52abbf6034
parent012137e2fc56e62c1b5b787a10a7f3b1e2eb9f54 (diff)
Remove amtc_bkr power-script
We can't satisfy requirements for amtc_bkr as amtc package is not part of Fedora/RHEL. Therefore, is not wise to ship it as part of Beaker by default. Change-Id: I0e5e2d66eb1ee7eac1075b36931351578f7f7f80 Signed-off-by: Martin Styk <mastyk@redhat.com>
-rwxr-xr-xLabController/src/bkr/labcontroller/power-scripts/amtc_bkr97
1 files changed, 0 insertions, 97 deletions
diff --git a/LabController/src/bkr/labcontroller/power-scripts/amtc_bkr b/LabController/src/bkr/labcontroller/power-scripts/amtc_bkr
deleted file mode 100755
index 1f65843..0000000
--- a/LabController/src/bkr/labcontroller/power-scripts/amtc_bkr
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh
-
-#Copyright (C) 2018,2019 Jirka Hladky (hladky DOT jiri AT gmail DOT com)
-
-#=============================================
-#Beaker agent for AMT 9.0+ hosts
-#
-#Usage:
-#power_mode=off power_pass=SECRET power_address=w541-mgmt.my_domain.com ./amtc_bkr
-#power_mode=on power_pass=SECRET power_address=w541-mgmt.my_domain.com ./amtc_bkr
-
-#It relies on the amtc tool :
-#https://github.com/schnoddelbotz/amtc
-#rpm packages: https://github.com/schnoddelbotz/amtc/releases
-#=============================================
-
-set -e
-set -x
-VERSION=1.0
-
-# amtc actions
-# -I(nfo) query powerstate via AMT [default]
-# -U(p) powerup given host(s)
-# -D(own) powerdown
-# -C(ycle) powercycle
-# -R(eset) reset
-# -X select PXE as device for next boot (AMT 9.0+)
-# -H select HDD as device for next boot (AMT 9.0+)
-# -S(hutdown) using AMT graceful shutdown (AMT 9.0+)
-# -(re)B(oot) using AMT graceful reset (AMT 9.0+)
-
-if [ "$power_mode" == interrupt ] ; then
- echo "interrupt not supported by amtc" >&2
- exit 1
-elif [ "$power_mode" = "on" ] ; then
- operation="-U"
-else
- operation="-D"
-fi
-
-
-target_mode="$power_mode"
-
-know_target_mode() {
- [ "$power_mode" == "on" -o "$power_mode" == "off" ]
-}
-
-get_current_mode() {
- current_mode=$(AMT_PASSWORD="$power_pass" amtc -I -d "$power_address" | grep -o "on\|off")
-}
-
-in_target_mode() {
- get_current_mode
- [ "$current_mode" == "$target_mode" ]
-}
-
-
-if know_target_mode && in_target_mode ; then
- AMT_PASSWORD="$power_pass" amtc -R -d "$power_address"
- sleep 20
- echo "State as reported by amtc -I" >&2
- AMT_PASSWORD="$power_pass" amtc -I -d "$power_address"
- if know_target_mode && in_target_mode ; then
- exit 0
- fi
-fi
-
-AMT_PASSWORD="$power_pass" amtc ${operation} -d "$power_address"
-
-if know_target_mode ; then
- for i in $(seq 20) ; do
- if in_target_mode ; then
- exit 0
- fi
- sleep 1
- done
- echo "Timed out waiting for $target_mode (Status: $current_mode)" >&2
- echo "State as reported by amtc -I" >&2
- AMT_PASSWORD="$power_pass" amtc -I -d "$power_address"
- echo "Trying Power Reset as the last option"
-
- AMT_PASSWORD="$power_pass" amtc -R -d "$power_address"
- sleep 20
- AMT_PASSWORD="$power_pass" amtc ${operation} -d "$power_address"
-
- for i in $(seq 20) ; do
- if in_target_mode ; then
- exit 0
- fi
- sleep 1
- done
- echo "Timed out waiting for $target_mode (Status: $current_mode)" >&2
- echo "Giving up" >&2
- echo "State as reported by amtc -I" >&2
- AMT_PASSWORD="$power_pass" amtc -I -d "$power_address"
- echo "amtc_bkr version ${VERSION}" >&2
-fi