Skip to content

Commit 43143fa

Browse files
committed
protosanitizer: test marshaling of arrays and maps
No code changes required because json handles those types for us, but it's still good to have a test case for it.
1 parent 179d6f9 commit 43143fa

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

protosanitizer/protosanitizer_test.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ func TestStripSecrets(t *testing.T) {
2828
secretName := "secret-abc"
2929
secretValue := "123"
3030
createVolume := &csi.CreateVolumeRequest{
31+
AccessibilityRequirements: &csi.TopologyRequirement{
32+
Requisite: []*csi.Topology{
33+
&csi.Topology{
34+
Segments: map[string]string{
35+
"foo": "bar",
36+
"x": "y",
37+
},
38+
},
39+
&csi.Topology{
40+
Segments: map[string]string{
41+
"a": "b",
42+
},
43+
},
44+
},
45+
},
3146
Name: "foo",
3247
VolumeCapabilities: []*csi.VolumeCapability{
3348
&csi.VolumeCapability{
@@ -55,7 +70,7 @@ func TestStripSecrets(t *testing.T) {
5570
{"hello world", `"hello world"`},
5671
{true, "true"},
5772
{false, "false"},
58-
{createVolume, `{"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}}}]}`},
73+
{createVolume, `{"accessibility_requirements":{"requisite":[{"segments":{"foo":"bar","x":"y"}},{"segments":{"a":"b"}}]},"capacity_range":{"required_bytes":1024},"name":"foo","secrets":"***stripped***","volume_capabilities":[{"AccessType":{"Mount":{"fs_type":"ext4"}}}]}`},
5974

6075
// There is currently no test case that can verify
6176
// that recursive stripping works, because there is no

0 commit comments

Comments
 (0)