mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 21:13:00 +02:00
38 lines
981 B
Python
Executable File
38 lines
981 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Set timezone with UTC offset
|
|
|
|
Verify that it is possible to set timezone using UTC offset
|
|
"""
|
|
import infamy
|
|
import lxml
|
|
|
|
from infamy.util import until
|
|
|
|
def get_timezone_offset():
|
|
try:
|
|
tz=target.get_data("/ietf-system:system/clock/timezone-utc-offset")
|
|
offset=tz.get("system", {}).get("clock",{}).get("timezone-utc-offset", 0)
|
|
return offset
|
|
except:
|
|
return None
|
|
|
|
with infamy.Test() as test:
|
|
with test.step("Set up topology and attach to target DUT"):
|
|
env = infamy.Env()
|
|
target = env.attach("target", "mgmt")
|
|
|
|
with test.step("Set timezone UTC offset to +12"):
|
|
target.put_config_dicts({"ietf-system": {
|
|
"system": {
|
|
"clock": {
|
|
"timezone-utc-offset": "12"
|
|
}
|
|
}
|
|
}})
|
|
|
|
with test.step("Verify current timezone is UTC+12:00"):
|
|
until(lambda: get_timezone_offset() == 12)
|
|
|
|
test.succeed()
|