Loading test/test.cpp +5 −3 Changes for test/test.cpp: 5 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -744,10 +744,11 @@ void testJoin(const std::string &dir) { std::getline(in, pw); CHECK(pw.size() == 32 && a["unicodePwd"].size() == 1 && a["unicodePwd"][0] == utf16(pw), "join: the password in unicodePwd (quoted, UTF-16LE) and in the secret file"); const std::vector<std::string> spns = { "HOST/FENRIR1", "HOST/fenrir1.example.com", "cifs/FENRIR1", "cifs/fenrir1.example.com" }; CHECK(a["sAMAccountName"] == std::vector<std::string>{ "FENRIR1$" } && a["userAccountControl"][0] == "4096" && a["msDS-SupportedEncryptionTypes"][0] == "24" && a["dNSHostName"][0] == "fenrir1.example.com" && a["servicePrincipalName"] == std::vector<std::string>{ "HOST/FENRIR1", "HOST/fenrir1.example.com", "cifs/FENRIR1", "cifs/fenrir1.example.com" }, a["servicePrincipalName"] == spns, "join: the account's attributes, cifs/ SPNs for SMB"); struct stat st; CHECK(stat(secret.c_str(), &st) == 0 && (st.st_mode & 077) == 0, "join: the secret file root only"); Loading @@ -767,7 +768,8 @@ void testJoin(const std::string &dir) { src.modify("CN=FENRIR1,CN=Computers,DC=example,DC=com", { { ldap::Connection::ModReplace, { "servicePrincipalName", { "HOST/FENRIR1", "host/fenrir1.example.com" } } } }); std::vector<std::string> added = addMissingSpns(src, admin, "FENRIR1$"); CHECK(added == (std::vector<std::string>{ "cifs/FENRIR1", "cifs/fenrir1.example.com" }), "SPNs: the missing cifs/ ones added"); const std::vector<std::string> cifs = { "cifs/FENRIR1", "cifs/fenrir1.example.com" }; CHECK(added == cifs, "SPNs: the missing cifs/ ones added"); fake::Object o3; srv.object("CN=FENRIR1,CN=Computers,DC=example,DC=com", o3); std::map<std::string, std::vector<std::string>> a3(o3.attrs.begin(), o3.attrs.end()); Loading Loading
test/test.cpp +5 −3 Changes for test/test.cpp: 5 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -744,10 +744,11 @@ void testJoin(const std::string &dir) { std::getline(in, pw); CHECK(pw.size() == 32 && a["unicodePwd"].size() == 1 && a["unicodePwd"][0] == utf16(pw), "join: the password in unicodePwd (quoted, UTF-16LE) and in the secret file"); const std::vector<std::string> spns = { "HOST/FENRIR1", "HOST/fenrir1.example.com", "cifs/FENRIR1", "cifs/fenrir1.example.com" }; CHECK(a["sAMAccountName"] == std::vector<std::string>{ "FENRIR1$" } && a["userAccountControl"][0] == "4096" && a["msDS-SupportedEncryptionTypes"][0] == "24" && a["dNSHostName"][0] == "fenrir1.example.com" && a["servicePrincipalName"] == std::vector<std::string>{ "HOST/FENRIR1", "HOST/fenrir1.example.com", "cifs/FENRIR1", "cifs/fenrir1.example.com" }, a["servicePrincipalName"] == spns, "join: the account's attributes, cifs/ SPNs for SMB"); struct stat st; CHECK(stat(secret.c_str(), &st) == 0 && (st.st_mode & 077) == 0, "join: the secret file root only"); Loading @@ -767,7 +768,8 @@ void testJoin(const std::string &dir) { src.modify("CN=FENRIR1,CN=Computers,DC=example,DC=com", { { ldap::Connection::ModReplace, { "servicePrincipalName", { "HOST/FENRIR1", "host/fenrir1.example.com" } } } }); std::vector<std::string> added = addMissingSpns(src, admin, "FENRIR1$"); CHECK(added == (std::vector<std::string>{ "cifs/FENRIR1", "cifs/fenrir1.example.com" }), "SPNs: the missing cifs/ ones added"); const std::vector<std::string> cifs = { "cifs/FENRIR1", "cifs/fenrir1.example.com" }; CHECK(added == cifs, "SPNs: the missing cifs/ ones added"); fake::Object o3; srv.object("CN=FENRIR1,CN=Computers,DC=example,DC=com", o3); std::map<std::string, std::vector<std::string>> a3(o3.attrs.begin(), o3.attrs.end()); Loading