Re: [PATCH] selftests: Add install, generate tar, and run_kselftest tools

From: Dave Jones
Date: Tue Mar 03 2015 - 09:49:29 EST


On Mon, Mar 02, 2015 at 09:48:08PM -0700, Shuah Khan wrote:
> kselftest_install.sh tool adds support for installing selftests
> at user specified location/kselftest. By default this tool
> will install selftests in the selftests/kselftest directory.
> For example, kselftest_install /tmp will install tests under
> /tmp/kselftest

How is this an improvement over having each test install method isolated
to its own Makefile ?

> +# Installs normal tests and skips special tests and kselftest tools
> +# gen_kselftesr_tar.sh and kselftes_install.sh
> +# Also skips problematic xxxx* file that gets created when execveat
> +# test is built. The file name is too long and resulting in error
> +# messages.
> + find `pwd`/* -type d -name rcutorture -prune -o -type f \
> + -executable -print | grep -v 'tar\|install\|xxxx' | \
> + xargs install -t $install_dir
> +# Install shell scripts that aren't executables
> + find `pwd`/* -type d -name rcutorture -prune -o -name "*.sh" -print | \
> + grep -v 'tar\|install\|run\|on-off' | \
> + xargs install -t $install_dir
> +# Special handling for cpu-hotplug and memory-hotplug .sh with the same name
> + install `pwd`/cpu-hotplug/on-off-test.sh \
> + $install_dir/cpu-on-off-test.sh
> + install `pwd`/memory-hotplug/on-off-test.sh \
> + $install_dir/mem-on-off-test.sh
> +# Special handling for scripts without .sh extension
> + install `pwd`/vm/run_vmtests $install_dir
> + install `pwd`/net/run_netsocktests $install_dir
> + install `pwd`/net/run_afpackettests $install_dir
> + install `pwd`/sysctl/common_tests $install_dir
> +# Install dependent directories for ftrace and exec tests
> + cp -r `pwd`/ftrace/test.d $install_dir
> + install `pwd`/exec/execveat.denatured $install_dir
> + cp -r `pwd`/exec/subdir $install_dir

This already makes my eyes hurt, and is only going to grow as more tests
get added. Additionally when two people are trying to add tests at the
same time, you're guaranteeing future merge conflicts here.

Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/