future date testing
Fairlight
fairlite at fairlite.com
Thu Jun 3 09:40:26 PDT 2010
Is it just me, or did Bill McEachran say:
> I need to test a routine that takes effect a month in the future.
>
> Anyone know of a technique to fool a filePro session into thinking the
> date is a month into the future without actually changing the system date?
> I have a test setup configured using $PFDIR on the production box ... so
> actually changing the date isn't feasible.
>
> I was hoping I could manipulate the date by setting TZ in the test users
> environment ... but I can only manipulate that by one day (unless
> there's a syntax I don't know about).
>
> Thanks.
Set up Sun VirtualBox with a guest OS underneath, and set the date on the
VM guest OS to whatever you need, and test the code on the VM. Which is
almost the same as saying, "Use another box for development," except it
being virtual, you don't need extra hardware.
There's not really a way to do it all on the same box. It's not like the
time is set in the alterable environment. Time calls are going to resolve
to the C function time(2), which goes by the system clock. That
methodology and the underlying mechanism is all or nothing.
Using TZ -might- work, if you could create your own timezone file, -and- if
setting an offset greater than +/- 2359 is allowable. I've never looked at
the timezone files enough to know. Bill Campbell might, though--he had
fixes for daylight savings before most linux vendors did, when they
switched the DST boundaries.
Personally, I'd say use a VM. If you use an OS that supports guest
extensions, you can allocate shared folders, so you could actually mount
the existing data directory and test on whatever you have already,
in-place, if you need to, rather than just a copy.
mark->
--
Audio panton, cogito singularis,
More information about the Filepro-list
mailing list