public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] controllers/cpuacct: rewrote testcases
Date: Mon, 9 Nov 2015 20:05:04 +0100	[thread overview]
Message-ID: <20151109190504.GA26979@rei> (raw)
In-Reply-To: <20151109175127.GC23947@rei>

Hi!
> > +	fi
> > +}
> > +
> > +mount_cpuacct()
> > +{
> > +	mount -t cgroup -o cpuacct none $mount_point
> > +	verify_result $? 0 "Error occured while mounting cgroup"
> 
> Interesting idea. Maybe we should add such function to the test.sh
> library. Something that would call tst_brkm on non zero $?. Something
> as:
> 
> mount -t cgroup -o cpuacct none $mount_point
> tst_brkm_err TCONF "Failed to mount cgroup $mount_point"
> 
> and the test.sh would have:
> 
> tst_brkm_err()
> {
> 	if [ $? -ne 0 ]; then
> 		tst_brkm $@
> 	fi
> }

And I nearly forgotten that we added even something better. We have ROD
function that works as:

ROD mount -t cgroup -o cpuacct none $mount_point

(ROD is acronym for run or die and it does exactly the thing you need)

FYI: Have a look at:

https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines#23-writing-a-testcase-in-shell

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2015-11-09 19:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  9:35 [LTP] [PATCH] controllers/cpuacct: rewrote testcases Cedric Hnyda
2015-11-09 17:51 ` Cyril Hrubis
2015-11-09 19:05   ` Cyril Hrubis [this message]
2015-11-10 11:00   ` 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=20151109190504.GA26979@rei \
    --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