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

Re: [libvirt] [PATCH] tests: fix compilation failures



On Mon, Jul 25, 2011 at 01:36:23PM -0600, Eric Blake wrote:
> 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?

Well we're not really testing the start time in this scenario, so
it doesn't really matter either way.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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