Thomas Lauf
5b87c962e7
Polish up bash scripts
...
- Use '-n' instead of '! -z'
- Quote all the things...
- Enclose variable references in '{}'
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2023-04-18 23:18:43 +02:00
Thomas Lauf
11a57e3cc5
Improve timemachine test-script
...
- Fix `--fail-at-end` option
- Collect errors and print report at end
- Make variable `tests` an array, add safeguards
- Combine cases
- Make variables `dates`, `hours`, `minutes` an array, add `pad_with_zero` function
- Execute test with specific 'runtime', so it picks up fake time
- Python scripts are then executed as `faketime <date> python3 <test>`
- Shell scripts as `faketime <date> bash <test>`
- Everything else as `faketime <date> <test>`
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2021-11-12 21:59:07 +01:00
Thomas Lauf
45672e05f3
Add options --hours
and --minutes
to inject a range
...
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-11-12 16:32:15 +01:00
Thomas Lauf
ad926480dd
Check exit code directly
...
- See https://github.com/koalaman/shellcheck/wiki/SC2181
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
2019-11-12 16:31:23 +01:00
Thomas Lauf
ef9a5b5a0a
Rename variable day
to dates
, function current_date
to default_dates
2019-03-02 18:01:56 +01:00
Thomas Lauf
b2fd299f33
Rename function random_minute
to default_minutes
2019-03-02 18:00:19 +01:00
Thomas Lauf
29d54086f4
Fix sed RE for mac os x
2019-03-02 17:57:57 +01:00
Thomas Lauf
428d377b84
Add missing -r
option to jot
...
- Otherwise output is always `0` and not a random number
2019-03-02 17:43:50 +01:00
Thomas Lauf
a6d97365fc
Add special handling for mac os x (mojave/darwin18)
...
- date does not have option `--rfc-3339`
- `rand` is not available, use `jot` instead
2019-03-02 17:01:55 +01:00
Thomas Lauf
f05596fa1d
Extract generation of current date into function
2019-03-02 16:59:36 +01:00
Thomas Lauf
e6b409144d
Extract generation of random minute into function
2019-03-02 16:58:50 +01:00
Thomas Lauf
544ebfadb7
Extract generation of default hours
2019-03-02 16:57:28 +01:00
Thomas Lauf
b248f13172
Add check for installed libfaketime
2019-03-02 16:55:47 +01:00
Thomas Lauf
02f05eec55
Fix filemode, faketime call
2019-01-20 23:10:17 +01:00
Thomas Lauf
68549dc22d
Add a timemachine tool script
...
- Wrapper around faketime
- Provides an interface to run tests at specific points in time
2019-01-19 10:32:00 +01:00
Thomas Lauf
9598f01fcf
Remove accidentially added files from repository
2018-12-06 13:36:17 +01:00
Thomas Lauf
c598f2bd66
Add lower bounds check for DOM tag reference
...
- Closes #189
2018-11-25 12:24:30 +01:00