torture-krb5: Improve the assertions in our KDC tests to be more explicit
authorAndrew Bartlett <abartlet@samba.org>
Mon, 2 Feb 2015 00:55:25 +0000 (13:55 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 8 Feb 2015 07:07:07 +0000 (08:07 +0100)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
source4/torture/krb5/kdc-canon.c

index 8c9543c9fa4ff1f609bc5c89a376537613ee763f..ef00e7031b00e24754022f74c7ebeffc172a5601 100644 (file)
@@ -366,6 +366,17 @@ static bool torture_krb5_post_recv_tgs_req_canon_test(struct torture_krb5_contex
                                         test_context->tgs_rep.ticket.sname.name_type,
                                         test_context->tgs_req.req_body.sname->name_type,
                                         "Mismatch in name_type between request and ticket response");
+               torture_assert_int_equal(test_context->tctx,
+                                        test_context->tgs_rep.ticket.sname.name_string.len,
+                                        test_context->tgs_req.req_body.sname->name_string.len,
+                                        "Mismatch in name_string.len between request and ticket response");
+               torture_assert(test_context->tctx,
+                              test_context->tgs_rep.ticket.sname.name_string.len >= 1,
+                              "name_string.len should be >=1 in ticket response");
+               torture_assert_str_equal(test_context->tctx,
+                                        test_context->tgs_rep.ticket.sname.name_string.val[0],
+                                        test_context->tgs_req.req_body.sname->name_string.val[0],
+                                        "Mismatch in name between request and expected request");
                torture_assert_int_equal(test_context->tctx,
                                         *test_context->tgs_rep.ticket.enc_part.kvno & 0xFFFF0000,
                                         0, "Unexpecedly got a RODC number in the KVNO, should just be principal KVNO");