HomeFreeBSD

Fix zdb calling behavior in ztest

Description

Fix zdb calling behavior in ztest

The current zdb calling behaviour is really fragile, and is guaranteed to
segfault if ztest is not installed in either /sbin or /usr/sbin. With this
patch, the ztest will try to call zdb in the following order.

  1. Use environmental variable ZDB_PATH if provided.
  2. If ztest resides in build tree, guess the in tree zdb path.
  3. Just pass zdb to popen and let it search it in PATH.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3126

Details

Provenance
Chunwei Chen <david.chen@osnexus.com>Authored on Nov 20 2015, 11:50 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Dec 2 2015, 10:50 PM
Parents
rGb0fe1adeb1f2: Prevent rm modules.* when make install
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG90aa094d6d77: Fix zdb calling behavior in ztest (authored by Chunwei Chen <david.chen@osnexus.com>).Dec 2 2015, 10:50 PM