@@ -132,39 +132,49 @@ def steps_TC_AVSM_2_7(self) -> list[TestStep]:
132
132
),
133
133
TestStep (
134
134
17 ,
135
+ "TH sends the VideoStreamAllocate command with the same arguments from step 10 except with StreamUsage set to Internal" ,
136
+ "DUT responds with a CONSTRAINT_ERROR status code." ,
137
+ ),
138
+ TestStep (
139
+ 18 ,
135
140
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except StreamUsage set to a value not in aStreamUsagePriorities." ,
136
141
"DUT responds with a INVALID IN STATE status code." ,
137
142
),
138
143
TestStep (
139
- 18 ,
144
+ 19 ,
140
145
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except MinFrameRate set to 0(outside of valid range)." ,
141
146
"DUT responds with a CONSTRAINT_ERROR status code." ,
142
147
),
143
148
TestStep (
144
- 19 ,
149
+ 20 ,
145
150
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except MinFrameRate > MaxFrameRate." ,
146
151
"DUT responds with a CONSTRAINT_ERROR status code." ,
147
152
),
148
153
TestStep (
149
- 20 ,
154
+ 21 ,
150
155
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except MinBitRate set to 0(outside of valid range)." ,
151
156
"DUT responds with a CONSTRAINT_ERROR status code." ,
152
157
),
153
158
TestStep (
154
- 21 ,
159
+ 22 ,
155
160
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except MinBitRate > MaxBitRate." ,
156
161
"DUT responds with a CONSTRAINT_ERROR status code." ,
157
162
),
158
163
TestStep (
159
- 22 ,
160
- "TH sends the VideoStreamAllocate command with the same arguments from step 10 except MinKeyFrameInterval > MaxKeyFrameInterval. " ,
164
+ 23 ,
165
+ "TH sends the VideoStreamAllocate command with the same arguments from step 10 except KeyFrameInterval > Max value " ,
161
166
"DUT responds with a CONSTRAINT_ERROR status code." ,
162
167
),
163
168
TestStep (
164
- 23 ,
169
+ 24 ,
165
170
"TH sends the VideoStreamAllocate command with the same arguments from step 10 except VideoCodec is set to 10 (out of range)." ,
166
171
"DUT responds with a CONSTRAINT_ERROR status code." ,
167
172
),
173
+ TestStep (
174
+ 25 ,
175
+ "TH sends the VideoStreamAllocate command with the same arguments from step 10 except MaxFrameRate set to a value not in aVideoSensorParams." ,
176
+ "DUT responds with a DYNAMIC_CONSTRAINT_ERROR status code." ,
177
+ ),
168
178
]
169
179
170
180
@run_if_endpoint_matches (
@@ -343,6 +353,36 @@ async def test_TC_AVSM_2_7(self):
343
353
self .skip_step (16 )
344
354
345
355
self .step (17 )
356
+ try :
357
+ outOfConstraintStreamUsage = Globals .Enums .StreamUsageEnum .kInternal
358
+ videoStreamAllocateCmd = commands .VideoStreamAllocate (
359
+ streamUsage = outOfConstraintStreamUsage ,
360
+ videoCodec = aRateDistortionTradeOffPoints [0 ].codec ,
361
+ minFrameRate = 30 , # An acceptable value for min frame rate
362
+ maxFrameRate = aVideoSensorParams .maxFPS ,
363
+ minResolution = aMinViewport ,
364
+ maxResolution = cluster .Structs .VideoResolutionStruct (
365
+ width = aVideoSensorParams .sensorWidth , height = aVideoSensorParams .sensorHeight
366
+ ),
367
+ minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
368
+ maxBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
369
+ keyFrameInterval = 4000 ,
370
+ watermarkEnabled = watermark ,
371
+ OSDEnabled = osd ,
372
+ )
373
+ await self .send_single_cmd (endpoint = endpoint , cmd = videoStreamAllocateCmd )
374
+ asserts .fail (
375
+ "Unexpected success when expecting CONSTRAINT_ERROR due to StreamUsage set to Internal" ,
376
+ )
377
+ except InteractionModelError as e :
378
+ asserts .assert_equal (
379
+ e .status ,
380
+ Status .ConstraintError ,
381
+ "Unexpected error returned when expecting CONSTRAINT_ERROR due to StreamUsage set to Internal" ,
382
+ )
383
+ pass
384
+
385
+ self .step (18 )
346
386
try :
347
387
notSupportedStreamUsage = next (
348
388
(e for e in Globals .Enums .StreamUsageEnum if e not in aStreamUsagePriorities and e != Globals .Enums .StreamUsageEnum .kInternal ),
@@ -375,7 +415,7 @@ async def test_TC_AVSM_2_7(self):
375
415
)
376
416
pass
377
417
378
- self .step (18 )
418
+ self .step (19 )
379
419
try :
380
420
videoStreamAllocateCmd = commands .VideoStreamAllocate (
381
421
streamUsage = aStreamUsagePriorities [0 ],
@@ -402,7 +442,7 @@ async def test_TC_AVSM_2_7(self):
402
442
)
403
443
pass
404
444
405
- self .step (19 )
445
+ self .step (20 )
406
446
try :
407
447
videoStreamAllocateCmd = commands .VideoStreamAllocate (
408
448
streamUsage = aStreamUsagePriorities [0 ],
@@ -429,7 +469,7 @@ async def test_TC_AVSM_2_7(self):
429
469
)
430
470
pass
431
471
432
- self .step (20 )
472
+ self .step (21 )
433
473
try :
434
474
videoStreamAllocateCmd = commands .VideoStreamAllocate (
435
475
streamUsage = aStreamUsagePriorities [0 ],
@@ -456,7 +496,7 @@ async def test_TC_AVSM_2_7(self):
456
496
)
457
497
pass
458
498
459
- self .step (21 )
499
+ self .step (22 )
460
500
try :
461
501
videoStreamAllocateCmd = commands .VideoStreamAllocate (
462
502
streamUsage = aStreamUsagePriorities [0 ],
@@ -483,7 +523,7 @@ async def test_TC_AVSM_2_7(self):
483
523
)
484
524
pass
485
525
486
- self .step (22 )
526
+ self .step (23 )
487
527
try :
488
528
videoStreamAllocateCmd = commands .VideoStreamAllocate (
489
529
streamUsage = aStreamUsagePriorities [0 ],
@@ -494,9 +534,9 @@ async def test_TC_AVSM_2_7(self):
494
534
maxResolution = cluster .Structs .VideoResolutionStruct (
495
535
width = aVideoSensorParams .sensorWidth , height = aVideoSensorParams .sensorHeight
496
536
),
497
- minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate + 1 ,
537
+ minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
498
538
maxBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
499
- keyFrameInterval = 4000 + 1 ,
539
+ keyFrameInterval = 65500 + 1 ,
500
540
watermarkEnabled = watermark ,
501
541
OSDEnabled = osd ,
502
542
)
@@ -510,7 +550,7 @@ async def test_TC_AVSM_2_7(self):
510
550
)
511
551
pass
512
552
513
- self .step (23 )
553
+ self .step (24 )
514
554
try :
515
555
videoStreamAllocateCmd = commands .VideoStreamAllocate (
516
556
streamUsage = aStreamUsagePriorities [0 ],
@@ -521,7 +561,7 @@ async def test_TC_AVSM_2_7(self):
521
561
maxResolution = cluster .Structs .VideoResolutionStruct (
522
562
width = aVideoSensorParams .sensorWidth , height = aVideoSensorParams .sensorHeight
523
563
),
524
- minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate + 1 ,
564
+ minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
525
565
maxBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
526
566
keyFrameInterval = 4000 ,
527
567
watermarkEnabled = watermark ,
@@ -537,6 +577,33 @@ async def test_TC_AVSM_2_7(self):
537
577
)
538
578
pass
539
579
580
+ self .step (25 )
581
+ try :
582
+ videoStreamAllocateCmd = commands .VideoStreamAllocate (
583
+ streamUsage = aStreamUsagePriorities [0 ],
584
+ videoCodec = aRateDistortionTradeOffPoints [0 ].codec ,
585
+ minFrameRate = 30 , # An acceptable value for min frame rate
586
+ maxFrameRate = aVideoSensorParams .maxFPS + 10 ,
587
+ minResolution = aMinViewport ,
588
+ maxResolution = cluster .Structs .VideoResolutionStruct (
589
+ width = aVideoSensorParams .sensorWidth , height = aVideoSensorParams .sensorHeight
590
+ ),
591
+ minBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
592
+ maxBitRate = aRateDistortionTradeOffPoints [0 ].minBitRate ,
593
+ keyFrameInterval = 4000 ,
594
+ watermarkEnabled = watermark ,
595
+ OSDEnabled = osd ,
596
+ )
597
+ await self .send_single_cmd (endpoint = endpoint , cmd = videoStreamAllocateCmd )
598
+ asserts .fail ("Unexpected success when expecting DYNAMIC_CONSTRAINT_ERROR due to unsupported MaxFrameRate" )
599
+ except InteractionModelError as e :
600
+ asserts .assert_equal (
601
+ e .status ,
602
+ Status .DynamicConstraintError ,
603
+ "Unexpected error returned when expecting DYNAMIC_CONSTRAINT_ERROR due to unsupported MaxFrameRate" ,
604
+ )
605
+ pass
606
+
540
607
541
608
if __name__ == "__main__" :
542
609
default_matter_test_main ()
0 commit comments