Opened 2 years ago

Closed 2 years ago

#22302 closed defect (fixed)

test-network.sh uses a deprecated arithmetic syntax

Reported by: catalyst Owned by: catalyst
Priority: Medium Milestone:
Component: Core Tor/Chutney Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

test-network.sh uses a deprecated bash-specific syntax to do arithmetic. This fails on systems like Ubuntu and Debian that use dash instead of bash for /bin/sh. test-network.sh should probably use the POSIX $((arithmetic_expr)) syntax instead.

Typical error from the log files:

/home/tlyu/src/tor/../chutney/tools/test-network.sh: 302: [: Illegal number: $[n_rounds+1]
Completed $[n_rounds+1] of 1 verify rounds.

Child Tickets

Change History (5)

comment:2 Changed 2 years ago by catalyst

Status: newneeds_review

oops, forgot to set needs_review

comment:3 Changed 2 years ago by teor

Milestone: Tor: unspecified
Status: needs_reviewmerge_ready

The bash thing will continue to haunt me until I switch my default sh.

This is the only instance of this pattern in chutney.

$ grep -r --exclude-dir .git --exclude-dir net --exclude '*~' '$[[]' .
./tools/test-network.sh:      n_rounds=$[n_rounds+1]

I think this is fine to merge, is there any reason it is WIP on gitlab?

comment:4 Changed 2 years ago by catalyst

I labeled it WIP partly to prevent accidental click-merge and partly to indicate it needed review. Feel free to ignore that, or I can delete the WIP notation if you want.

comment:5 Changed 2 years ago by teor

Resolution: fixed
Status: merge_readyclosed

Closed by merging 9e48988 into master.

Note: See TracTickets for help on using tickets.