File: datasource_timestamp_ms.sh

package info (click to toggle)
snoopy 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,988 kB
  • sloc: ansic: 7,167; sh: 4,514; makefile: 1,095
file content (33 lines) | stat: -rwxr-xr-x 692 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash



### Configure shell and bootstrap
#
set -e
set -u
. `dirname $BASH_SOURCE`/_bootstrap.sh



### Get data
#
VAL_SNOOPY_1=`$SNOOPY_TEST_CLI run datasource timestamp_ms`
sleep 0.005
VAL_SNOOPY_2=`$SNOOPY_TEST_CLI run datasource timestamp_ms`
if [ "$VAL_SNOOPY_1" -gt "$VAL_SNOOPY_2" ]; then
    VAL_SNOOPY_1=`$SNOOPY_TEST_CLI run datasource timestamp_ms`
    sleep 0.005
    VAL_SNOOPY_2=`$SNOOPY_TEST_CLI run datasource timestamp_ms`
fi



### Evaluate
#
VAL_DIFF=`expr $VAL_SNOOPY_2 - $VAL_SNOOPY_1`
if [[ "$VAL_DIFF" -ge "5" ]] && [[ "$VAL_DIFF" -lt "500" ]]; then
    snoopy_testResult_pass "$VAL_DIFF"
else
    snoopy_testResult_fail "${VAL_SNOOPY_1}ms ${VAL_SNOOPY_2}ms"
fi