-
Notifications
You must be signed in to change notification settings - Fork 16
test: Add storm ab update tests #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
f9281ee
wait for login progress
frhuelsz 8c1579b
Merge branch 'main' into user/frhuelsz/storm/e2e-2
frhuelsz 75da58c
retrieve serial
frhuelsz b7e00dc
remove all ansi from log
frhuelsz 59442d1
Improve artifact management
frhuelsz 8fa9296
Merge branch 'main' into user/frhuelsz/storm/e2e-2
frhuelsz 8b23b74
serial updates
frhuelsz 6402941
serial console
frhuelsz 107f0a0
Fully functional console monitoring
frhuelsz 8b38db0
undo update
frhuelsz 5475842
Update pipeline invocation with output
frhuelsz 8e28210
More reliability
frhuelsz e5f1ac9
Use storm v0.4.0-alpha1
frhuelsz 1e4be22
cleanup
frhuelsz 01a900f
pr comments
frhuelsz 775ac0a
pr comments
frhuelsz b61883c
Refactor to use runtime type everywhere
frhuelsz ed996fa
Check ssh
frhuelsz bad81cd
refactor netlisten
frhuelsz f8f27c4
Fix import order
frhuelsz 99556b5
Update config construction
frhuelsz bd19b57
Cleanup change from other branch
frhuelsz c98ed7e
refactor netlisten
frhuelsz 077d0a0
Merge branch 'user/frhuelsz/netlisten-refactor' into user/frhuelsz/st…
frhuelsz 62608b2
Address copilot feedback
frhuelsz 47022ed
more copilot comments
frhuelsz a81f67f
pr comments
frhuelsz 54db467
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz abfc0df
Updates
frhuelsz 81cf17e
PR comments
frhuelsz ce5ff54
Comment
frhuelsz 354b373
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz abf6f3f
progress
frhuelsz 9df0e11
Fix deadlock
frhuelsz af24a13
Close channel on error
frhuelsz 5e4370c
avoid resource leak
frhuelsz 4f9ea11
more robust console exit
frhuelsz cf1ae9c
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz 7f4ee67
AB-update
frhuelsz 2d7996e
Better force exit console
frhuelsz 3da66b7
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz 3b27bee
everything
frhuelsz 742ba91
Merge branch 'main' into user/frhuelsz/storm/e2e-3
frhuelsz a0a457d
pr comments
frhuelsz 22c2ada
cleanup
frhuelsz 5b5dc46
pr comments
frhuelsz 66001c7
pr comments
frhuelsz 305fc8c
pr comments
frhuelsz 4202b1d
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz 07fa9bb
pr comments
frhuelsz e878682
PR comments :)
frhuelsz 3c7333e
pr comments
frhuelsz a34f55f
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz 0ae93ac
pr comments
frhuelsz 5c0dce3
pr comments
frhuelsz bbabee7
pr comments
frhuelsz dfa2506
pr comments
frhuelsz eb38c19
Merge branch 'user/frhuelsz/storm/e2e-2' into user/frhuelsz/storm/e2e-3
frhuelsz f86cde9
pr comments
frhuelsz 47ea524
pr comments
frhuelsz 4aff2f9
Merge branch 'main' into user/frhuelsz/storm/e2e-3
frhuelsz f290fb7
fix TridentRuntimeType
frhuelsz 2633138
Merge branch 'main' into user/frhuelsz/storm/e2e-3
frhuelsz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,5 @@ | ||
| package hostconfig | ||
|
|
||
| func (s *HostConfig) HasABUpdate() bool { | ||
| return s.Container.Exists("storage", "abUpdate") | ||
| } | ||
This file contains hidden or 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,79 @@ | ||
| package hostconfig | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/Jeffail/gabs/v2" | ||
frhuelsz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "gopkg.in/yaml.v3" | ||
| ) | ||
|
|
||
| // HostConfig represents the configuration for a host. It uses a gabs.Container | ||
| // to manage the underlying data structure. | ||
| type HostConfig struct { | ||
| *gabs.Container | ||
| } | ||
|
|
||
| // NewHostConfigFromContainer creates a new HostConfig from an existing gabs.Container. | ||
| func NewHostConfigFromContainer(container *gabs.Container) HostConfig { | ||
| return HostConfig{ | ||
| Container: container, | ||
| } | ||
| } | ||
|
|
||
| // NewHostConfigFromInterface creates a new HostConfig from a generic interface{}. | ||
| func NewHostConfigFromInterface(data interface{}) HostConfig { | ||
| return HostConfig{ | ||
| Container: gabs.Wrap(data), | ||
| } | ||
| } | ||
|
|
||
| // NewHostConfigFromYaml creates a new HostConfig from a YAML byte slice. | ||
| func NewHostConfigFromYaml(yamlData []byte) (HostConfig, error) { | ||
| var data map[string]any | ||
| err := yaml.Unmarshal(yamlData, &data) | ||
| if err != nil { | ||
| return HostConfig{}, fmt.Errorf("failed to unmarshal YAML data: %w", err) | ||
| } | ||
|
|
||
| return HostConfig{ | ||
| Container: gabs.Wrap(data), | ||
| }, nil | ||
| } | ||
|
|
||
| // GetContainer returns the underlying gabs.Container of the HostConfig. | ||
| func (hc *HostConfig) GetContainer() *gabs.Container { | ||
| return hc.Container | ||
| } | ||
|
|
||
| // Data returns the underlying data of the HostConfig as an interface{}. | ||
| func (hc *HostConfig) ToInterface() interface{} { | ||
| return hc.Container.Data() | ||
| } | ||
|
|
||
| // ToYaml serializes the HostConfig to a YAML byte slice. | ||
| func (hc *HostConfig) ToYaml() ([]byte, error) { | ||
| data, err := yaml.Marshal(hc.Data()) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to marshal HostConfig to YAML: %w", err) | ||
| } | ||
|
|
||
| return data, nil | ||
| } | ||
|
|
||
| // Clone creates a deep copy of the HostConfig. | ||
| func (s *HostConfig) Clone() (HostConfig, error) { | ||
| // Unfortunately there is no direct way to clone an interface{}/any type, in | ||
| // Go, so the easiest way is to serialize to YAML and deserialize back. This | ||
| // is by no means the most efficient way, but it works for our purposes. | ||
| yamlData, err := s.ToYaml() | ||
| if err != nil { | ||
| return HostConfig{}, err | ||
| } | ||
|
|
||
| copy, err := NewHostConfigFromYaml(yamlData) | ||
| if err != nil { | ||
| return HostConfig{}, err | ||
| } | ||
|
|
||
| return copy, nil | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
HasABUpdatemethod only checks for the existence of "storage" and "abUpdate" keys but doesn't validate that abUpdate is not nil or has valid content. Consider adding validation to ensure the abUpdate configuration is actually usable.