From 72c0a679a1101aada8d22c98abf7bde615fa7a11 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Mon, 14 Dec 2020 19:12:25 +0200 Subject: [#1611] make date +%s -d 4 seconds work on alpine --- src/lib/testutils/dhcp_test_lib.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index dab439e0b3..955be6a9ba 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -423,8 +423,8 @@ get_process_name() { # Wait for file to be created. wait_for_file() { local file=${1} - timeout='4 seconds' - deadline=$(date +%s -d "${timeout}") + timeout='4' # seconds + deadline=$(($(date +%s) + timeout)) while ! test -f "${file}"; do if test "${deadline}" -lt "$(date +%s)"; then # Time is up. @@ -439,8 +439,8 @@ wait_for_file() { # Wait for process identified by PID to die. wait_for_process_to_die() { local pid=${1} - timeout='4 seconds' - deadline=$(date +%s -d "${timeout}") + timeout='4' # seconds + deadline=$(($(date +%s) + timeout)) while ps "${pid}" >/dev/null; do if test "${deadline}" -lt "$(date +%s)"; then # Time is up. -- cgit v1.2.3