[LTP] [PATCH v3 1/1] isofs.sh: Test genisoimage, xorriso and mksisofs

Cyril Hrubis chrubis@suse.cz
Mon Jan 29 17:42:12 CET 2024


Hi!
> @@ -50,10 +39,33 @@ do_test()
>  	local make_file_sys_dir="$PWD/files"
>  	local mkisofs_opt mount_opt
>  
> +	case $1 in
> +		1) MKISOFS_CMD="mkisofs"
> +			HFSOPT="-hfs -D"
> +			GREPOPT="mkisofs";;
> +		2) MKISOFS_CMD="genisoimage"
> +			HFSOPT="-hfsplus -D -hfs -D"
> +			GREPOPT="genisoimage";;
> +		3) MKISOFS_CMD="xorrisofs"
> +			HFSOPT="-hfsplus -D"
> +			GREPOPT="xorriso";;
> +	esac
> +
> +	tst_res TINFO "Testing $MKISOFS_CMD"
                ^
               Maybe this should be after the two TCONF messages so that
	       we do not print:

	       INFO: "Testing foo"
	       CONF: "Missing foo"


Other than that it does look fine, as long as it's well tested feel free
to add this for the release.

Reviewed-by: Cyril Hrubis

> +	if ! tst_cmd_available $MKISOFS_CMD; then
> +		tst_res TCONF "Missing '$MKISOFS_CMD'"
> +		return
> +	fi
> +
> +	if ! $MKISOFS_CMD 2>&1 | head -n 2 | grep -q "$GREPOPT"; then
> +		tst_res TCONF "'$MKISOFS_CMD' is a symlink to another tool"
> +		return
> +	fi
> +
>  	mkdir -p -m 777 $mnt_point
>  	mkdir -p $make_file_sys_dir
>  
> -	# Generated directories and files
>  	mkdir -p $make_file_sys_dir
>  	gen_fs_tree "$make_file_sys_dir" 1
>  
> @@ -62,15 +74,16 @@ do_test()
>  	for mkisofs_opt in \
>  		" " \
>  		"-J" \
> -		"-hfs -D" \
> +		"$HFSOPT" \
>  		" -R " \
>  		"-R -J" \
>  		"-f -l -D -J -allow-leading-dots -R" \
> -		"-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -allow-leading-dots -R"
> +		"-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J \
> +			-allow-leading-dots -R"
>  	do
>  		rm -f isofs.iso
> -		EXPECT_PASS $MKISOFS_CMD -o isofs.iso -quiet $mkisofs_opt $make_file_sys_dir 2\> /dev/null \
> -			|| continue
> +		EXPECT_PASS $MKISOFS_CMD -o isofs.iso -quiet $mkisofs_opt \
> +			$make_file_sys_dir 2\> /dev/null || continue
>  
>  		for mount_opt in \
>  			"loop" \
> -- 
> 2.43.0
> 

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list