Skip to content
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

Timesync: Add max size name check #27619

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/python_testing/TC_TIMESYNC_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ async def test_TC_TIMESYNC_2_4(self):
tz = [tz_struct(offset=50401, validAt=0)]
await self.send_set_time_zone_cmd_expect_error(tz=tz, error=Status.ConstraintError)

self.print_step(14, "Send SetTimeZone command - too long name")
tz = [tz_struct(offset=50401, validAt=0, name="AVeryLongStringWithSixtyFiveChars/ThisIsSomeExtraPaddingForTheStr")]
self.print_step(14, "Send SetTimeZone command with max sized name")
tz = [tz_struct(offset=0, validAt=0, name="AVeryLongStringWithSixtyFourChars/ThisIsSomeExtraPaddingForTheSt")]
ret = await self.send_set_time_zone_cmd(tz=tz)
asserts.assert_true(ret.DSTOffsetRequired, "DSTOffsetRequired not set to true")

self.print_step(15, "Send SetTimeZone command - too long name")
tz = [tz_struct(offset=0, validAt=0, name="AVeryLongStringWithSixtyFiveChars/ThisIsSomeExtraPaddingForTheStr")]
await self.send_set_time_zone_cmd_expect_error(tz=tz, error=Status.ConstraintError)

self.print_step(15, "Send SetTimeZone command - too many entries")
self.print_step(16, "Send SetTimeZone command - too many entries")
if tz_max_size_dut == 2:
tz = [tz_struct(offset=3600, validAt=0, name="Europe/Dublin"),
tz_struct(offset=7200, validAt=utc_time_in_matter_epoch() +
Expand All @@ -128,15 +133,15 @@ async def test_TC_TIMESYNC_2_4(self):
]
await self.send_set_time_zone_cmd_expect_error(tz=tz, error=Status.ResourceExhausted)

self.print_step(16, "Send SetTimeZone command - too many entries")
self.print_step(17, "Send SetTimeZone command - too many entries")
if tz_max_size_dut == 1:
tz = [tz_struct(offset=3600, validAt=0, name="Europe/Dublin"),
tz_struct(offset=7200, validAt=utc_time_in_matter_epoch() +
timedelta(minutes=2).microseconds, name="Europe/Athens")
]
await self.send_set_time_zone_cmd_expect_error(tz=tz, error=Status.ResourceExhausted)

self.print_step(17, "Reset time zone")
self.print_step(18, "Reset time zone")
tz = [tz_struct(offset=0, validAt=0)]
await self.send_set_time_zone_cmd(tz=tz)

Expand Down