
Early airshipctl usage has identified the need to eject virtual media on-demand using airshipctl in order to prevent booting from stuck media. This change adds a command to eject all virtual media attached to a baremetal node. Change-Id: Id67fa00489093dcb84ce54216e0553fa6a737ea6 Signed-off-by: Drew Walters <andrew.walters@att.com>
72 lines
1.7 KiB
Go
72 lines
1.7 KiB
Go
/*
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package baremetal_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"opendev.org/airship/airshipctl/cmd/baremetal"
|
|
"opendev.org/airship/airshipctl/testutil"
|
|
)
|
|
|
|
func TestBaremetal(t *testing.T) {
|
|
tests := []*testutil.CmdTest{
|
|
{
|
|
Name: "baremetal-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewBaremetalCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-ejectmedia-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewEjectMediaCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-isogen-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewISOGenCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-poweroff-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewPowerOffCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-poweron-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewPowerOnCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-powerstatus-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewPowerStatusCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-reboot-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewRebootCommand(nil),
|
|
},
|
|
{
|
|
Name: "baremetal-remotedirect-with-help",
|
|
CmdLine: "-h",
|
|
Cmd: baremetal.NewRemoteDirectCommand(nil),
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
testutil.RunTest(t, tt)
|
|
}
|
|
}
|