mercredi 19 avril 2017

Fake the current date/timestamp in DB2 LUW for testing

For (non regression) testing purpose, I frequently need to make DB2 LUW return a "fake" current date. This is of course due to application code that rely on the current date / timestamp , and which will behave differently when run during a different date.

We have the possibility to change the operating system (Linux for instance) date , since the testing environment are isolated and dedicated per tester.

Unfortunately, this doesn't help a lot, since we face at least two problems :

1) Binding programs (Cobol) when the system date goes backward gives errors (tables not found, ...)

2) Functions created after the 'past' system date are also not usable....

For the point 1), we can set the date to present , then bind, then come back to past, But for point 2), I didn't find a workaround.

Does anybody have experience on this problem ? Any alternatives including free or proprietary software are welcome.

Aucun commentaire:

Enregistrer un commentaire