Re: [PATCH] fdisk: add simple test for doslabel stuff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 13, 2009 at 02:37:36PM +0200, Zdenek Behan wrote:
> Initial tests/fdisk patch to test most of the doslabel-related stuff.
> Coverage of dos-related functions is about 60%, does not test the  
> verify/fix-PT code.
>
> Signed-off-by: Zdenek Behan <rain@xxxxxxxxx>
> ---
>  tests/ts/fdisk/doslabel |   85  

 Applied. I did some changes to your test. Unfortunately, the "Delete
 extended partition" returns a different MD5 sum. Please,
 
 try:

    $ cd tests
    $ ./run..sh fdisk
    $ cat diff/fdisk/doslabel

 and review the patch in git tree.

> +function verify_md5sum() {
> +       FILE=${TEST_IMAGE_NAME}
> +       EXPECTED=${1}
> +       MD5=$(md5sum ${FILE}|cut -f1 -d' ')
> +       [ "${MD5}" = "${EXPECTED}" ] && return 0
> +
> +       ts_die "Failed md5 check"
> +}

 it's better to use "ts_finalize" function to check diffs between 
 expected/fdisk/doslabel and real output at output/fdisk/doslabel

> +ts_log "Create new DOS partition table" # need to run init twice, to  
> change system ID after new label, otherwise system ID will be random and  
> will screw up md5's

 Please, use git-send-email. Really. Your mail client produces
 malformed mails (patches).

> +echo -e  
> "${FDISK_CMD_INIT}${FDISK_CMD_CREATE_DOSLABEL}${FDISK_CMD_INIT}${FDISK_CMD_WRITE_CLOSE}" 
> | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null

 you need to add, TS_CMD_FDISK to commands.sh.in :-)

 Thanks for the test! I love regression tests :-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux