diff mbox series

[ndctl,v3,1/2] test/monitor.sh convert float to integer before increment

Message ID 20241018013020.2523845-1-lizhijian@fujitsu.com (mailing list archive)
State New
Headers show
Series [ndctl,v3,1/2] test/monitor.sh convert float to integer before increment | expand

Commit Message

Zhijian Li (Fujitsu) Oct. 18, 2024, 1:30 a.m. UTC
The test log reported:
test/monitor.sh: line 149: 40.0: syntax error: invalid arithmetic operator (error token is ".0")

It does stop the test prematurely. We never run the temperature
inject test case of test_filter_dimmevent() because of the inability
to increment the float.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
V3:
  split as a separate patch
---
 test/monitor.sh | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/test/monitor.sh b/test/monitor.sh
index c5beb2c..7049b36 100755
--- a/test/monitor.sh
+++ b/test/monitor.sh
@@ -146,6 +146,7 @@  test_filter_dimmevent()
 	stop_monitor
 
 	inject_value=$($NDCTL list -H -d $monitor_dimms | jq -r .[]."health"."temperature_threshold")
+	inject_value=${inject_value%.*}
 	inject_value=$((inject_value + 1))
 	start_monitor "-d $monitor_dimms -D dimm-media-temperature"
 	inject_smart "-m $inject_value"