linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.33k stars 1.02k forks source link

mq_open01 fail #1163

Open KingingWang opened 4 months ago

KingingWang commented 4 months ago
SELinux mode: unknown
no big block device was specified on commandline.
Tests which require a big block device are disabled.
You can specify it with option -z
COMMAND:    /userdata/wzh/ltp/bin/ltp-pan   -e -S   -a 24195     -n 24195 -p -f /tmp/ltp-LT56OlZ0qM/alltests -l /userdata/wzh/ltp/results/LTP_RUN_ON-2024_06_20-08h_55m_08s.log  -C /userdata/wzh/ltp/output/LTP_RUN_ON-2024_06_20-08h_55m_08s.failed -T /userdata/wzh/ltp/output/LTP_RUN_ON-2024_06_20-08h_55m_08s.tconf
INFO: Restricted to mq_open01
LOG File: /userdata/wzh/ltp/results/LTP_RUN_ON-2024_06_20-08h_55m_08s.log
FAILED COMMAND File: /userdata/wzh/ltp/output/LTP_RUN_ON-2024_06_20-08h_55m_08s.failed
TCONF COMMAND File: /userdata/wzh/ltp/output/LTP_RUN_ON-2024_06_20-08h_55m_08s.tconf
Running tests.......
<<<test_start>>>
tag=mq_open01 stime=1718873708
cmdline="mq_open01"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
tst_test.c:1690: TINFO: LTP version: 20230929
tst_test.c:1576: TINFO: Timeout per run is 0h 00m 30s
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:253: TFAIL: NORMAL wrong return code: -1: EMFILE (24)

I changed the testcase, and it was passable after that.

static struct test_case tcase[] = {
    {
        .desc = "NORMAL",
        .qname = QUEUE_NAME,
        .oflag = O_CREAT,
        .rq = &(struct mq_attr){.mq_maxmsg = 10, .mq_msgsize = 8192},
        .ret = 0,
        .err = 0,
    }
};

But when I change mq_maxmsg and mq_maxsize, it doesn't pass the test, it seems that the changes don't take effect.

root@c3b:/userdata/wzh/output# cat /proc/sys/fs/mqueue/msgsize_max
1024
root@c3b:/userdata/wzh/output# cat /proc/sys/fs/mqueue/queues_max
256
root@c3b:/userdata/wzh/output# cat /proc/sys/fs/mqueue/msg_max
10
root@c3b:/userdata/wzh/output# cat /proc/sys/fs/mqueue/msgsize_max
8192
root@c3b:/userdata/wzh/output# echo 10240 > /proc/sys/fs/mqueue/queues_max
root@c3b:/userdata/wzh/output# echo 100 > /proc/sys/fs/mqueue/msg_max
root@c3b:/userdata/wzh/output# echo 16384 > /proc/sys/fs/mqueue/msgsize_max
pevik commented 4 months ago

You are using old LTP. Although mq_open01.c was not modified since (20230929), generally it's recommended to use the latest release or current master branch.

It's hard knowing without the details about the system to see whether it's a test failure or kernel failure.