Skip to content

Commit cde25c5

Browse files
committed
test: skip TestClientUpdateResourceInRFOTM when it is not supported
1 parent d3d7622 commit cde25c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

client/updateResource_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ func TestClientUpdateResourceInRFOTM(t *testing.T) {
217217
require.NoError(t, errC)
218218
}()
219219

220+
_, links, err := c.GetDevice(ctx, deviceID)
221+
require.NoError(t, err)
222+
l, ok := links.GetResourceLink(test.TestResourceLightInstanceHref("1"))
223+
if !ok {
224+
t.Skip("Device doesn't support light resource")
225+
}
226+
if len(l.GetUnsecureEndpoints()) == 0 {
227+
t.Skip("Device doesn't support access to light resource via unsecure endpoint")
228+
}
229+
220230
for _, tt := range tests {
221231
t.Run(tt.name, func(t *testing.T) {
222232
err = c.UpdateResource(ctx, tt.args.deviceID, tt.args.href, tt.args.data, nil, tt.args.opts...)

0 commit comments

Comments
 (0)