From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Wang Date: Wed, 25 Mar 2020 13:30:09 +0800 Subject: [LTP] [PATCH 2/2] Use SAFE_RUNCMD() In-Reply-To: <20200325015324.GA15127@yuki.lan> References: <20200320134937.16616-1-pvorel@suse.cz> <20200320134937.16616-2-pvorel@suse.cz> <303d1019-f836-b2ae-ce51-d2c46dd7fb1e@cn.fujitsu.com> <20200323113738.GA4807@dell5510> <20200323160415.GC15673@dell5510> <20200324235150.GC4521@yuki.lan> <20200324172102.GA1307@dell5510> <20200325015324.GA15127@yuki.lan> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it On Wed, Mar 25, 2020 at 1:57 AM Cyril Hrubis wrote: > Hi! > > > Also if we are going to add this functionality it should be added as an > > > .needs_cmds array in the tst_test structure. > > .needs_cmds sounds as a good idea. But let's do it as a separate effort. > +1, thanks Petr! > > I'll leave already sent v2 for review. Once .needs_cmds is implemented, > we can > > use it as well for copy_file_range02.c. > > Actually I would like to avoid exposing the function to the tests and > force people to use the .needs_cmds instead in order to have a proper > metadata. > Sounds good. And this makes me think more of the '.request_hugepages' story. The needs_foo flags require the foo to be present on the system as hard requirements. In some situations(i.e copy_file_range02.c), we probably need to handle the soft situation, which means, the commands are only part of the test requirement. So if it writing with .needs_cmds="xxx", it might skip the whole test in setup() phase. So things are clear now, checking for the command existence in tst_run_cmd_fds_() is really necessary. For the test with "cmds" is needed just adding the .needs_cmds="xxx", for the test with "cmds" is only part of it, we can avoid writing '.needs_cmds' but calling tst_run_cmd() function directly. -- Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: