|
183 | 183 | > might behave differently. While that can happen in practice, that would be |
184 | 184 | > a bug to report and pursue fixing. |
185 | 185 |
|
| 186 | +The tests use mocked tools under the `t` directory. Notably, the mock operation |
| 187 | +to `zfs list` generates a large listing of dataset snapshots (once a minute for |
| 188 | +an hour, by default), leading to significant test times like an hour or two! |
| 189 | + |
| 190 | +To speed up development iterations, when you just want to make sure no simple |
| 191 | +regressions were added, you can `export ZNAPZENDTEST_ZFS_list_max_snapshots=3` |
| 192 | +or so to significantly speed up the test suite. |
| 193 | + |
| 194 | +Also note that interrupted tests tend to leave the `znapzend*.pid` files in |
| 195 | +place (and corresponding daemons may remain running), so before re-running |
| 196 | +the tests you may want to follow up with `make clean-pidfiles` to kill any |
| 197 | +processes mentioned in those files (if present) and remove them. |
| 198 | + |
| 199 | +Combining the suggestions above, a relatively quick developer testing command |
| 200 | +(taking about 5 minutes for the full suite), optionally with a log file to |
| 201 | +later trawl for errors (if any), could look like this: |
| 202 | + |
| 203 | +```sh |
| 204 | +:; ZNAPZENDTEST_ZFS_list_max_snapshots=3 make clean-pidfiles check \ |
| 205 | + 2>&1 | tee "test-make-check-`date +%s`.log" |
| 206 | +``` |
| 207 | + |
| 208 | +To speed up development of tests (or to troubleshoot/debug any failures), |
| 209 | +you can also craft and execute individual test cases using the mock tools, |
| 210 | +by just preferring them in your `PATH`, e.g.: |
| 211 | + |
| 212 | +```sh |
| 213 | +:; PATH="`pwd`/t:$PATH" ./bin/znapzendzetup \ |
| 214 | + edit --donotask --tsformat=%Y%m%d-%H%M%S \ |
| 215 | + SRC "1h=>10min" tank/source \ |
| 216 | + DST:0 "1h=>10min" backup/destination |
| 217 | +``` |
| 218 | + |
| 219 | +As usual with Perl programming, you can run the interpreter with one of the |
| 220 | +development/debugging modules enabled (may need to install some from CPAN |
| 221 | +or your OS packaging), e.g. `Devel::ebug` or `Devel::Trace`: |
| 222 | + |
| 223 | +```sh |
| 224 | +:; perl -d:Trace ./bin/znapzendzetup \ |
| 225 | + edit --donotask --recursive=on \ |
| 226 | + SRC tank/source |
| 227 | +``` |
| 228 | + |
186 | 229 | Packages |
187 | 230 | -------- |
188 | 231 |
|
|
0 commit comments