Re: [PATCH] tests: fix compilation failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/25/2011 09:39 AM, Daniel P. Berrange wrote:
(struct testTLSCertReq): Alter time members.
(testTLSGenerateCert): Reflect the change.
(mymain): Reduce stack usage.
---


-    /* if zero, then the current time will be used */
-    time_t start;
-    time_t expire;
+    /* zero for current time, or non-zero for hours from now */
+    int start_offset;
+    /* zero for 24 hours from now, or non-zero for hours from now */
+    int expire_offset;
  };



This is actually a change in semantics introduced here. The
start/expire values were treated as absolute values, eg in
places we pass '1' for expiry time to indicate a time way
in the past. This has now become 1 hour into the future.
This is why the 3 expiry tests were broken.

I pushed the following change to make sure the expiry tests
have times in the past again

+++ b/tests/virnettlscontexttest.c
@@ -1112,7 +1112,7 @@ mymain(void)
          true, true, true,
          true, true, GNUTLS_KEY_KEY_CERT_SIGN,
          false, false, NULL, NULL,
-        0, 1,
+        0, -1,

Ah - while I fixed the future stamps, I forgot to fix the past stamps. ACK to this change; however, I still find it odd that the start time is now but the expire time is in the past. Instead, shouldn't we be using something like start time of -2 and expire time of -1, so the start time still comes before the expire time?

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]