Change date-and-time format
According to RFC 6991[1], the canonical format for date-and-time is
local time. That means that when printing the canonical value, the
string is adjusted to the timezone of the machine. This is undesirable
for testing and overall (we want everything to be UTC). Specifying "Z"
means that the timezone is known and is UTC. On the other hand,
specifying "-00:00" means that the timezone is unknown and no timezone
correction should be done.
[1]: https://datatracker.ietf.org/doc/html/rfc6991
Change-Id: Idf956624ca56431f232a20c33e55f69311e2e51c
diff --git a/tests/hardware_ietf-hardware.cpp b/tests/hardware_ietf-hardware.cpp
index db75eea..feaaa11 100644
--- a/tests/hardware_ietf-hardware.cpp
+++ b/tests/hardware_ietf-hardware.cpp
@@ -194,7 +194,7 @@
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/parent", "ne:ctrl"},
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/class", "iana-hardware:module"},
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/serial-num", "0x00a8808d"},
- {"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/mfg-date", "2017-02-01T00:00:00Z"},
+ {"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/mfg-date", "2017-02-01T00:00:00-00:00"},
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc']/model-name", "8GME4R"},
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc:lifetime']/class", "iana-hardware:sensor"},
{"/ietf-hardware:hardware/component[name='ne:ctrl:emmc:lifetime']/parent", "ne:ctrl:emmc"},
@@ -376,7 +376,7 @@
{"[name='ne:ctrl:emmc']/parent", "ne:ctrl"},
{"[name='ne:ctrl:emmc']/class", "iana-hardware:module"},
{"[name='ne:ctrl:emmc']/serial-num", "0x00a8808d"},
- {"[name='ne:ctrl:emmc']/mfg-date", "2017-02-01T00:00:00Z"},
+ {"[name='ne:ctrl:emmc']/mfg-date", "2017-02-01T00:00:00-00:00"},
{"[name='ne:ctrl:emmc']/model-name", "8GME4R"},
{"[name='ne:ctrl:emmc']/sensor-data", ""},
{"[name='ne:ctrl:emmc:lifetime']/name", "ne:ctrl:emmc:lifetime"},
diff --git a/tests/sysrepo_authentication.cpp b/tests/sysrepo_authentication.cpp
index dc9a61b..6754195 100644
--- a/tests/sysrepo_authentication.cpp
+++ b/tests/sysrepo_authentication.cpp
@@ -57,9 +57,9 @@
auto data = dataFromSysrepo(test_srSess, "/czechlight-system:authentication/users");
decltype(data) expected = {
{"[name='ci']/name", "ci"},
- {"[name='ci']/password-last-change", "2024-10-04T00:00:00Z"},
+ {"[name='ci']/password-last-change", "2024-10-04T00:00:00-00:00"},
{"[name='root']/name", "root"},
- {"[name='root']/password-last-change", "2020-09-09T00:00:00Z"},
+ {"[name='root']/password-last-change", "2020-09-09T00:00:00-00:00"},
{"[name='root']/authorized-keys[index='0']", ""},
{"[name='root']/authorized-keys[index='0']/index", "0"},
{"[name='root']/authorized-keys[index='0']/public-key", "ssh-rsa SOME_KEY comment"}