From 2165a1368b1f6d4973f4c0d0f712f97e99e29648 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 7 Feb 2022 14:16:20 +0100 Subject: [PATCH] test: helloworld to work in a minimal (openwrt) environment --- test/lib.sh | 3 +++ test/test_helloworld.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/lib.sh b/test/lib.sh index c223a951..a9d673bc 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -123,6 +123,9 @@ fi # Multiplication factor to sleep less than whole seconds DEMSLEEP=.2 +# Some sleep implementations cannot handle sub-seconds, change to 1s +sleep $DEMPSLEEP || DEMSLEEP=1 + # DEMWAIT is expressed in seconds, but really * DEMSLEEP let DEMLOOP=5*DEMWAIT diff --git a/test/test_helloworld.sh b/test/test_helloworld.sh index 280cc244..5b111295 100755 --- a/test/test_helloworld.sh +++ b/test/test_helloworld.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Hello world smoketest test # A minimal test for backend/cli/netconf/restconf # See clixon-example/hello @@ -25,7 +25,7 @@ cat < $cfg $clispec hello $dir/hello.sock - $dir/hello.pidfile + /var/run/helloworld.pid $dir init false