[LTP] [PATCH v2] syscalls/ioprio: Add test cases for I/O priority

Cyril Hrubis chrubis@suse.cz
Thu Jul 18 12:15:03 CEST 2019


Hi!
> > +	/* Bump to best effort scheduling, all 8 priorities */
> > +	class = IOPRIO_CLASS_BE;
> > +
> > +	fail_in_loop = 0;
> > +	for (prio = 0; prio < 8; prio++) {
> > +		TEST(ioprio_set(IOPRIO_WHO_PROCESS, 0,
> > +				IOPRIO_PRIO_VALUE(class, prio)));
> > +		if (TST_RET == -1) {
> > +			tst_res(TFAIL | TTERRNO, "ioprio_set IOPRIO_CLASS_BE prio %d failed", prio);
> > +			fail_in_loop = 1;
> > +		}
> > +	}
> > +	if (!fail_in_loop)
> > +		tst_res(TPASS, "tested all 8 prios in class %s",
> > +			 to_class_str[class]);
> 
> Just btw, we don't have to have the fail_in_loop variable here
> (fail_in_loop) == (prio < 8)

And that only works when we have a break; on failure, which we don't
have here...

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list