From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC] shell wrappers for tst_checkpoint
Date: Thu, 2 Jun 2016 17:58:11 +0300 [thread overview]
Message-ID: <57504983.5010106@oracle.com> (raw)
In-Reply-To: <20160601150345.GA23934@rei.lan>
Hi!
On 06/01/2016 06:03 PM, Cyril Hrubis wrote:
> Hi!
>> There is a need to use the tst_checkpoint interface from shell, but
>> we don't have wrappers for it (yet).
>>
>> Patch 1 of the series contains one possible implementation for that,
>> patch 2 - an example of usage in the context of the memcg_functional test case.
>>
>> I'd like to get some feedback from LTP users.
>>
>> My primary concern is about two issues:
>>
>> 1. The new test API for C is cool and takes the responsibility on
>> maintaining the infrastructure for tst_checkpoint. However, I couldn't find
>> a way to implement something similar in shell, so I switched back to using
>> two separate functions for that - TST_CHECKPOINT_SETUP, TST_CHECKPOINT_CLEANUP.
>>
>> There may be a better way...
>
> Well we can always put the cleanup into the tst_exit() which is executed
> both on clean and unclean exit (tst_brkm). And the setup could be done
> right after the checks for TCID and TST_TOTAL. Both supposedly if
> something as TST_NEEDS_CHECKPOINTS=1 has been set before sourcing
> test.sh.
>
> Also nothing stops us from bringing the shell API closer to what we have
> for C :).
>
> We would have to source the test library script after we had defined all
> the setup() cleanup() and test() functions and after setting the
> corresponding TST_ID=foo, TST_NEEDS_CHECKPOINTS=1, etc. But as far as I
> can tell it seems doable.
Could, you, please, have a look at the attached series. I suppose it
addresses your proposal. In particular, the changes are:
* tst_checkpoint_* binaries were moved to testcases/lib/
* logic from TST_CHECKPOINT_CLEANUP was moved to tst_exit()
* logic from TST_CHECKPOINT_SETUP was moved right into tst_test.sh
(now it depends on TST_NEEDS_CHECKPOINTS flag)
Existent test cases should not be affected by this change.
If checkpoints are needed, TST_NEEDS_CHECKPOINTS must be defined before
'.test.sh'. I think this fact could be documented.
>
> And it would be really cool if we managed to use the shared memory for
> test results as well so that result from child processes (subshells)
> would be propagated automatically as well.
Yes, but may this be addressed sometimes later :)
>
>> 2. What is the best location for the new supplemental binaries (tst_checkpoint_wait,
>> tst_checkpoint_wake)? tools/apicmds/ltpapicmd.c or separate source files in
>> testcases/lib/ (similar to tst_sleep)?
>
> I would go for separate binary in testcases/lib/ rather than adding to
> the ltpapicmd.c which should really be removed at some point in future,
> once there are no users for the binary tst_resm.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-shell-wrapper-for-tst_checkpoint.patch
Type: text/x-patch
Size: 4897 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160602/7b15e917/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-an-example-of-usage.patch
Type: text/x-patch
Size: 4677 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160602/7b15e917/attachment-0001.bin>
next prev parent reply other threads:[~2016-06-02 14:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 14:34 [LTP] [RFC] shell wrappers for tst_checkpoint Stanislav Kholmanskikh
2016-06-01 14:34 ` [LTP] [RFC PATCH 1/2] a draft for tst_checkpoint shell wrappers Stanislav Kholmanskikh
2016-06-01 14:34 ` [LTP] [RFC PATCH 2/2] An example of usage of " Stanislav Kholmanskikh
2016-06-01 15:12 ` Cyril Hrubis
2016-06-01 15:03 ` [LTP] [RFC] shell wrappers for tst_checkpoint Cyril Hrubis
2016-06-02 14:58 ` Stanislav Kholmanskikh [this message]
2016-06-06 8:40 ` Cyril Hrubis
2016-06-02 7:58 ` Jan Stancek
2016-06-02 8:20 ` Stanislav Kholmanskikh
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=57504983.5010106@oracle.com \
--to=stanislav.kholmanskikh@oracle.com \
--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