test: ignore rgw cli flag order in unit test
In the unit test that ensures `rgwCommandFlags` works properly, ignore the ordering of the flags. Golang maps are used underneath, which results in random flag ordering. This is fine as long as the `rgwCommandFlags` are still guaranteed to be appended to the args Rook normally applies. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
This commit is contained in:
1 file changed
+5
-3
@@ -982,10 +982,12 @@ func TestRgwCommandFlags(t *testing.T) {
|
||||
}
|
||||
rgwContainer, err := c.makeDaemonContainer(rgwConfig)
|
||||
assert.NoError(t, err)
|
||||
// ordering of additional args amongst themselves doesn't matter (and is random b/c of
|
||||
// underlying map data type), but it is still important that the additional args are always
|
||||
// after the args Rook normally applies
|
||||
l := len(rgwContainer.Args)
|
||||
assert.Equal(t, "--rgw-option=val spaced", rgwContainer.Args[l-3])
|
||||
assert.Equal(t, "--rgw-option=val-dashed", rgwContainer.Args[l-2])
|
||||
assert.Equal(t, "--rgw-option=val_underscored", rgwContainer.Args[l-1])
|
||||
addedArgs := rgwContainer.Args[l-3:]
|
||||
assert.ElementsMatch(t, []string{"--rgw-option=val spaced", "--rgw-option=val-dashed", "--rgw-option=val_underscored"}, addedArgs)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user