From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] commands/insmod: add new testcase to test insmod(8)
Date: Mon, 18 Apr 2016 17:44:19 +0200 [thread overview]
Message-ID: <20160418154419.GA11649@rei.lan> (raw)
In-Reply-To: <1458029005-8807-1-git-send-email-fenggw-fnst@cn.fujitsu.com>
Hi!
> +# Check a module file existence
> +# Should be called after tst_tmpdir()
> +tst_module_exists()
> +{
> + local mod_name="$1"
> +
> + if [ -f "$mod_name" ]; then
> + TST_MODPATH="$mod_name"
> + return
> + fi
> +
> + local mod_path="$LTPROOT/testcases/bin/$mod_name"
> + if [ -f "$mod_path" ]; then
> + TST_MODPATH="$mod_path"
> + return
> + fi
> +
> + if [ -n "$TST_TMPDIR" ]; then
> + mod_path="$TST_TMPDIR/$mod_name"
> + if [ -f "$mod_path" ]; then
> + TST_MODPATH="$mod_path"
> + return
> + fi
> + fi
This is not what the lib/tst_module.c does. It tries test startwd which
is recorded before the test does chdir() to the newly created test
directory. Otherwise if the test calls tst_tmpdir() the module in the
directory the test was started in will not be found. So we have to
record the test start working directory in tst_tmpdir() and use it here.
Otherwise it looks good.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-04-18 15:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 7:07 [LTP] [PATCH 1/2] commands/lsmod: Added new testcase to test lsmod(8) Guangwen Feng
2015-12-18 7:07 ` [LTP] [PATCH 2/2] commands/insmod: Added new testcase to test insmod(8) Guangwen Feng
2016-01-27 16:28 ` Cyril Hrubis
2016-01-28 9:42 ` Guangwen Feng
2016-03-15 8:03 ` [LTP] [PATCH v2] commands/insmod: add " Guangwen Feng
2016-04-18 2:33 ` Guangwen Feng
2016-04-18 15:44 ` Cyril Hrubis [this message]
2016-04-22 6:28 ` [LTP] [PATCH v3] " Guangwen Feng
2016-05-10 16:28 ` Cyril Hrubis
2016-01-27 16:11 ` [LTP] [PATCH 1/2] commands/lsmod: Added new testcase to test lsmod(8) Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160418154419.GA11649@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox