The test is not portable

Bug #999273 reported by Alexey Kopytov on 2012-05-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup
Alexey Kopytov
Alexey Kopytov
Alexey Kopytov

Bug Description

The test introduced with has a number of portability issues:

- the values for 'count' and 'seek' are in 512-byte units. So we actually write 8 MB of zeroes starting with the 512 KB offset. Is that intentional?

- On *BSD and OSX "wc" has a different output format (the number is prepended with a tab character). But the next check compares "$COUNT" and "1" as strings rather than numbers. So that expression is always false. Besides, we don't really need the count of matched lines, all we need is the grep exit code (i.e. if there was at least one matching line).

So this:

> set +e
> COUNT=`xtrabackup --backup --datadir=$mysql_datadir --target-dir=$topdir/backup 2>&1 \
> | grep "File ./sakila/rental.ibd seems to be corrupted" | wc -l `
> set -e
> if [ "$COUNT" != "1" ] ; then
> vlog "test failed"
> exit 1
> fi

is equivalent to the following 2 lines that are also more portable:

> run_cmd_expect_failure $XB_BIN $XB_ARGS --backup --datadir=$mysql_datadir \
> --target-dir=$topdir/backup
> grep -q "File ./sakila/rental.ibd seems to be corrupted" $OUTFILE

Related branches

summary: - The test is not portable
+ The test is not portable
Alexey Kopytov (akopytov) wrote :

Reassigning to myself as this bug blocks my testing of replication support in the test suite.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers