HomeFreeBSD

ZTS: Make bc conditional use compatible with new BSD bc

Description

ZTS: Make bc conditional use compatible with new BSD bc

FreeBSD recently replaced the GNU bc and dc in the base system with
BSD licensed versions. They are supposed to be compatible with all
the features present in the GNU versions, but it turns out they are
picky about if statements having a corresponding else. ZTS uses
echo "if ($x > $y) 1" | bc in a few places, which causes tests to
fail unexpectedly with the new bc.

Change the two expressions in ZTS to if ($x > $y) 1 else 0 for
compatibility with the new BSD bc.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10551

Details

Provenance
freqlabsAuthored on Jul 10 2020, 12:49 AM
GitHub <noreply@github.com>Committed on Jul 10 2020, 12:49 AM
Parents
rG659f4008be86: libzfs: Make zfs_cmd_t initialization consistent, use zfs_ioctl
Branches
Unknown
Tags
Unknown