Re: [PATCH v2 4/6] overlay/017: create helpers to record and check inode numbers

Eryu Guan
2017-04-28T09:24:04Z

On Fri, Apr 28, 2017 at 11:24:46AM +0300, Amir Goldstein wrote:
> Use helpers to records and check inode numbers so we can repeat
> the same test after rename and mount cycle.
>
> Suggested-by: Eryu Guan <eguan@redhat.com>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> tests/overlay/017 | 57 ++++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 42 insertions(+), 15 deletions(-)
>
> diff --git a/tests/overlay/017 b/tests/overlay/017
> index 779907d..3ff429f 100755
> --- a/tests/overlay/017
> +++ b/tests/overlay/017
> @@ -72,32 +72,59 @@ mknod $lowerdir/blkdev b 1 1
> mknod $lowerdir/fifo p
> $here/src/af_unix $lowerdir/socket
>
> +FILES="dir file symlink chrdev blkdev fifo socket"
> +
> +# Record inode numbers in format <ino> <basename>
> +function record_inode_numbers()
> +{
> + dir=$1
> + outfile=$2
> +
> + for f in $FILES; do
> + ls -id $dir/$f
> + done | \
> + while read ino file; do
> + echo $ino `basename $file` >> $outfile
> + done
> +}
> +
> +# Check inode numbers match recorder inode numbers
> +function check_inode_numbers()
> +{
> + dir=$1
> + before=$2
> + after=$2
^^^ $3
Otherwise looks good to me. I can fix this typo at commit time.

But I've already kicked off release testing for this week's update,
I'll queue these patches for next update.

Thanks,
Eryu