Re: [LTP] [PATCH] move_pages09: move_pages returns 0 if nothing got migrated

Caspar Zhang
2012-05-09T10:26:22Z

On 05/09/2012 05:11 PM, Jan Stancek wrote:
> + if ((tst_kvercmp(2, 6, 28)) >= 0) {
> + if (ret == 0)
> + tst_resm(TPASS, "move_pages succeeded");
> + else
> + tst_resm(TFAIL, "move_pages failed with: %s",
> + strerror(TEST_ERRNO));

Hi Jan,

We can use: tst_resm(TFAIL|TERRNO, "move_pages");

This will produce messages like:

TFAIL : move_pages: errno=ENOENT(2): No such file or directory

> + } else {
> + if (ret == -1 && errno == ENOENT)
> + tst_resm(TPASS, "move_pages failed with "
> + "ENOENT as expected");
> + else
> + tst_resm(TFAIL, "move_pages failed with: "
> + "%s", strerror(TEST_ERRNO));

Here as well.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net