All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/3] cgroup: Add memcontrol02
Date: Tue, 21 Dec 2021 12:14:40 +0100	[thread overview]
Message-ID: <YcG3IB2Oksw77mbg@yuki> (raw)
In-Reply-To: <87a6gufd77.fsf@suse.de>

Hi!
> > But even then all the macros all written in a way that they do expect
> > a syscall as a first parameter and the messages are not clear.
> 
> Possibly it should just be TST_EXP(bool_expr, fmt, ...). That would be like
> practically every other testing framework. OTOH LTP is somewhat special
> as we usually are checking the return value of a syscall. So I should
> probably leave these macros alone in this case.

Sounds reasonably.

> > Maybe we need a different solution. We already have tst_assert_foo()
> > functions for sysfs/proc files so maybe we need something as compare
> > function for the cgroup file attributes:
> 
> Frankly that is poor naming. One would expect tst_assert to be similar
> to assert from assert.h.

Feel free to propose rename if you have a better idea.

> >
> > 	enum cmp {
> > 		CMP_EQ,
> > 		CMP_NE,
> > 		CMP_LT,
> > 		CMP_GT,
> > 		CMP_LE,
> > 		CMP_GE,
> > 		CMP_EPS,
> > 	};
> >
> > 	CGROUP_ASSERT_CMP_SIZE(cg_child, "memory.current", CMP_EQ, 0);
> >
> > 	CGROUP_ASSERT_CMP_SIZE(cg_child, "memory.current", CMP_EPS, file, 10);
> >
> >
> > 	or even simple macro that would compare two values accordingly
> > 	to the OP and print PASS/FAIL would be better than this.
> >
> 
> I think it would be simpler to just create a general assert_expr
> macro. The above function won't neatly handle loading multiple values
> from multiple files. Nor will it handle transforming values.

Yes, that is one of the limitations.

> We could implement SQL queries for sys files, like osquery, that would
> be neat!

Hmm, we do allready have boolean parser in LTP library, maybe we can
just reuse that, as long as we add a code that parses specified sysfs
files into variables that are passed to the parser it should work
reasonably well for us.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2021-12-21 11:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 13:10 [LTP] [PATCH 1/3] API/cgroup: Add safe_cgroup_lines_scanf Richard Palethorpe via ltp
2021-12-20 13:10 ` [LTP] [PATCH 2/3] API/cgroup: Add memory.stat Richard Palethorpe via ltp
2021-12-20 15:15   ` Cyril Hrubis
2021-12-20 13:10 ` [LTP] [PATCH 3/3] cgroup: Add memcontrol02 Richard Palethorpe via ltp
2021-12-20 15:44   ` Cyril Hrubis
2021-12-21  8:38     ` Richard Palethorpe
2021-12-21 11:14       ` Cyril Hrubis [this message]
2021-12-20 15:08 ` [LTP] [PATCH 1/3] API/cgroup: Add safe_cgroup_lines_scanf Cyril Hrubis
2021-12-30 10:37 ` [LTP] [PATCH v2 1/5] " Richard Palethorpe via ltp
2021-12-30 10:37   ` [LTP] [PATCH v2 2/5] API/cgroup: Add memory.stat Richard Palethorpe via ltp
2021-12-30 10:37   ` [LTP] [PATCH v2 3/5] API/fs: Add exfat magic Richard Palethorpe via ltp
2021-12-30 10:37   ` [LTP] [PATCH v2 4/5] API: Add TST_EXP_EXPR macro Richard Palethorpe via ltp
2021-12-30 10:37   ` [LTP] [PATCH v2 5/5] cgroup: Add memcontrol02 Richard Palethorpe via ltp
2022-01-03  9:45     ` Petr Vorel
2022-01-03  9:51   ` [LTP] [PATCH v2 1/5] API/cgroup: Add safe_cgroup_lines_scanf Petr Vorel

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=YcG3IB2Oksw77mbg@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.