Use date utilities from libyang-cpp
Unfortunately, our CI still does not have std::chrono implementation
we need in order to not require the date lib.
Also change date timezones from -00:00 to local timezone.
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/dependencies/+/7234
Change-Id: If0ca8fc049a9a3b41853144f5c3b81532b0e349d
diff --git a/tests/sysrepo_authentication.cpp b/tests/sysrepo_authentication.cpp
index a71fc37..15ed388 100644
--- a/tests/sysrepo_authentication.cpp
+++ b/tests/sysrepo_authentication.cpp
@@ -6,6 +6,8 @@
*/
#include "trompeloeil_doctest.h"
+#include <chrono>
+#include <libyang-cpp/Time.hpp>
#include <sysrepo-cpp/utils/exception.hpp>
#include "fs-helpers/FileInjector.h"
#include "fs-helpers/utils.h"
@@ -55,14 +57,16 @@
FileInjector rootKeys(testDir / "authorized_keys/root", std::filesystem::perms::owner_read,
"ssh-rsa SOME_KEY comment"
);
+
+ using namespace std::chrono;
auto data = dataFromSysrepo(client, "/czechlight-system:authentication/users");
decltype(data) expected = {
{"[name='ci']", ""},
{"[name='ci']/name", "ci"},
- {"[name='ci']/password-last-change", "2024-10-04T00:00:00-00:00"},
+ {"[name='ci']/password-last-change", libyang::yangTimeFormat(sys_days(2024y/October/4), libyang::TimezoneInterpretation::Local)},
{"[name='root']", ""},
{"[name='root']/name", "root"},
- {"[name='root']/password-last-change", "2020-09-09T00:00:00-00:00"},
+ {"[name='root']/password-last-change", libyang::yangTimeFormat(sys_days(2020y/September/9), libyang::TimezoneInterpretation::Local)},
{"[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"}