Files
infix/test/case/ietf_system/timezone.py
T
Mattias Walström dd0f1610ab Add get_current_time_with_offset to netconf/restconf
This allows the timezone tests to run on restconf as well
2024-06-27 15:43:06 +02:00

28 lines
711 B
Python
Executable File

#!/usr/bin/env python3
import random, string
import time
import infamy
import lxml
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
target = env.attach("target", "mgmt")
with test.step("Set timezone"):
target.put_config_dict("ietf-system", {
"system": {
"clock": {
"timezone-name": "Australia/Perth" # always +8:00, no DTS
}
}
})
with test.step("Verify current time."):
current_datetime=target.get_current_time_with_offset()
offset=current_datetime[-6:]
assert(offset == "+08:00")
test.succeed()