Skip to content
Permalink
Browse files

Extract generation of default hours

  • Loading branch information...
lauft committed Mar 2, 2019
1 parent b248f13 commit 544ebfadb734cc950af573df9c03bc7eea355edf
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/timemachine
@@ -1,5 +1,10 @@
#!/bin/bash

function default_hours()
{
seq -w 0 23
}

if ! command -v faketime >/dev/null 2>&1 ; then
echo "timemachine requires libfaketime to be installed!"
exit 1
@@ -36,7 +41,7 @@ done

for day in ${days-$(date --rfc-3339=date)} ; do
for minute in ${minutes-$(echo "0$(rand -M 60)" | sed "s|.\+\(..\)\$|\1|g")} ; do
for hour in ${hours-$(seq -w 0 23)} ; do
for hour in ${hours-$( default_hours )} ; do
date="${day}T${hour}:${minute}"
for single_test in ${tests} ; do
echo "Running test ${single_test} at ${date}"

0 comments on commit 544ebfa

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.