Skip to content

Commit

Permalink
e2e: fix command filenames in test output directories
Browse files Browse the repository at this point in the history
%04g-target formatting resulted in filenames like -1.0329e+121-vm in
some environments. As COMMAND_COUNTER is a natural number, let us
format it using %d for consistent results.

Signed-off-by: Antti Kervinen <[email protected]>
  • Loading branch information
askervin authored and klihub committed Nov 1, 2024
1 parent 8e49db8 commit 56c46c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/lib/command.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ command-start() {
COMMAND_COUNTER=$(( COMMAND_COUNTER + 1 ))
local command_start_time=$(epochrealtime)
local time_since_start=$(echo "$command_start_time - $command_init_time" | bc)
COMMAND_OUT_FILE="$COMMAND_OUTPUT_DIR/$(printf %04g $COMMAND_COUNTER)-$COMMAND_TARGET"
COMMAND_OUT_FILE="$COMMAND_OUTPUT_DIR/$(printf %04d $COMMAND_COUNTER)-$COMMAND_TARGET"
echo "# start time: $time_since_start" > "$COMMAND_OUT_FILE" || {
echo "cannot write command output to file \"$COMMAND_OUT_FILE\""
exit 1
Expand Down

0 comments on commit 56c46c7

Please sign in to comment.