Skip to content

tests/9p: introduce declarative function calls

Christian Schoenebeck qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20tests/9p: merge *walk*() functionstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+198 -1400 replies
2/20tests/9p: simplify callers of twalk()tests/qtest/virtio-9p-test.c+32 -600 replies
3/20tests/9p: merge v9fs_tversion() and do_version()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+68 -270 replies
4/20tests/9p: merge v9fs_tattach(), do_attach(), do_attach_rqid()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+88 -440 replies
5/20tests/9p: simplify callers of tattach()tests/qtest/virtio-9p-test.c+8 -110 replies
6/20tests/9p: convert v9fs_tgetattr() to declarative argumentstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+63 -100 replies
7/20tests/9p: simplify callers of tgetattr()tests/qtest/virtio-9p-test.c+7 -150 replies
8/20tests/9p: convert v9fs_treaddir() to declarative argumentstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+65 -110 replies
9/20tests/9p: simplify callers of treaddir()tests/qtest/virtio-9p-test.c+11 -100 replies
10/20tests/9p: convert v9fs_tlopen() to declarative argumentstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+69 -140 replies
11/20tests/9p: simplify callers of tlopen()tests/qtest/virtio-9p-test.c+10 -330 replies
12/20tests/9p: convert v9fs_twrite() to declarative argumentstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+72 -150 replies
13/20tests/9p: simplify callers of twrite()tests/qtest/virtio-9p-test.c+3 -60 replies
14/20tests/9p: convert v9fs_tflush() to declarative argumentstests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+47 -70 replies
15/20tests/9p: merge v9fs_tmkdir() and do_mkdir()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+78 -300 replies
16/20tests/9p: merge v9fs_tlcreate() and do_lcreate()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+79 -350 replies
17/20tests/9p: merge v9fs_tsymlink() and do_symlink()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+73 -260 replies
18/20tests/9p: merge v9fs_tlink() and do_hardlink()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+73 -270 replies
19/20tests/9p: merge v9fs_tunlinkat() and do_unlinkat()tests/qtest/libqos/virtio-9p-client.c tests/qtest/libqos/virtio-9p-client.h tests/qtest/virtio-9p-test.c+64 -280 replies
20/20tests/9p: remove unnecessary g_strdup() callstests/qtest/libqos/virtio-9p-client.c+8 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/20] tests/9p: introduce declarative function calls

This series converts relevant 9p (test) client functions to use named function arguments. For instance

    do_walk_expect_error(v9p, "non-existent", ENOENT);

becomes

    twalk({
        .client = v9p, .path = "non-existent", .expectErr = ENOENT
    });

The intention is to make the actual 9p test code more readable, and easier to maintain on the long-term.

Not only makes it clear what a literal passed to a function is supposed to do, it also makes the order and selection of arguments very liberal, and allows to merge multiple, similar functions into one single function.

This is basically just refactoring, it does not change behaviour.

PREREQUISITES
=============

This series requires the following additional patch to work correctly:

https://lore.kernel.org/all/[email protected]/
https://github.com/cschoenebeck/qemu/commit/23d01367fc7a4f27be323ed6d195c527bec9ede1

Christian Schoenebeck (20):
tests/9p: merge *walk*() functions
tests/9p: simplify callers of twalk()
tests/9p: merge v9fs_tversion() and do_version() tests/9p: merge v9fs_tattach(), do_attach(), do_attach_rqid() tests/9p: simplify callers of tattach()
tests/9p: convert v9fs_tgetattr() to declarative arguments tests/9p: simplify callers of tgetattr()
tests/9p: convert v9fs_treaddir() to declarative arguments tests/9p: simplify callers of treaddir()
tests/9p: convert v9fs_tlopen() to declarative arguments tests/9p: simplify callers of tlopen()
tests/9p: convert v9fs_twrite() to declarative arguments tests/9p: simplify callers of twrite()
tests/9p: convert v9fs_tflush() to declarative arguments tests/9p: merge v9fs_tmkdir() and do_mkdir() tests/9p: merge v9fs_tlcreate() and do_lcreate() tests/9p: merge v9fs_tsymlink() and do_symlink() tests/9p: merge v9fs_tlink() and do_hardlink() tests/9p: merge v9fs_tunlinkat() and do_unlinkat() tests/9p: remove unnecessary g_strdup() calls

 tests/qtest/libqos/virtio-9p-client.c | 569 +++++++++++++++++++++-----
 tests/qtest/libqos/virtio-9p-client.h | 408 ++++++++++++++++--
 tests/qtest/virtio-9p-test.c          | 529 ++++++++----------------
 3 files changed, 1031 insertions(+), 475 deletions(-)
Signature · 1 line
2.30.2