-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define multiple structs to implement the tests. Signed-off-by: Alexander Hansen <[email protected]>
- Loading branch information
1 parent
1dd4fd8
commit bdda71b
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package test | ||
|
||
// This struct is used to pass arbitrary information into the tests | ||
// such as IP address, expected FRU content, expected sensors | ||
type TestConfig struct { | ||
|
||
Host string; | ||
Username string; | ||
Password string; | ||
|
||
// ... to be extended | ||
} | ||
|
||
type Result struct { | ||
|
||
// what was tested | ||
Name string | ||
|
||
// != nil in case something went wrong, | ||
// this should contain a descriptive string for the logs. | ||
// e.g. "while running command X, expected A but output was B' | ||
Error error | ||
} | ||
|
||
type Test struct { | ||
|
||
// e.g. "IPMI Sensor" | ||
Name string | ||
|
||
// e.g. "Testing the 'ipmitool sensor' output | ||
Description string | ||
|
||
Function func(tc TestConfig) []Result | ||
} |