# HG changeset patch # User Paul Boddie # Date 1627770188 -7200 # Node ID d596a19482945665545a744491120c84da59f621 # Parent 73649ab3a61d05126b9140d1395f000ef6c28b46 Introduced usage of the filesystem factory operation in the relevant tests. diff -r 73649ab3a61d -r d596a1948294 conf/dstest_ext2.cfg --- a/conf/dstest_ext2.cfg Sun Aug 01 00:07:00 2021 +0200 +++ b/conf/dstest_ext2.cfg Sun Aug 01 00:23:08 2021 +0200 @@ -25,11 +25,16 @@ }, "rom/dstest_ext2_server", "blocksvr", "rom/e2test.fs", "10", "ext2svr"); +-- Obtain user filesystems with umask 0022 (18). + +local getuserfs = 6; +local ext2svr_paulb = L4.cast(L4.Proto.Factory, ext2svr):create(getuserfs, 1000, 1000, 18); + l:startv({ caps = { - server = ext2svr, + server = ext2svr_paulb, }, log = { "client", "g" }, }, - -- program, file to read, user identifier, repetition - "rom/dstest_block_client_simple", "home/paulb/LICENCE.txt", "1000", "1"); + -- program, file to read, user identifier (omitted), repetition + "rom/dstest_block_client_simple", "home/paulb/LICENCE.txt", "", "1"); diff -r 73649ab3a61d -r d596a1948294 conf/dstest_file.cfg --- a/conf/dstest_file.cfg Sun Aug 01 00:07:00 2021 +0200 +++ b/conf/dstest_file.cfg Sun Aug 01 00:23:08 2021 +0200 @@ -25,11 +25,16 @@ }, "rom/dstest_ext2_server", "blocksvr", "rom/e2test.fs", "10", "ext2svr"); +-- Obtain user filesystems with umask 0022 (18). + +local getuserfs = 6; +local ext2svr_paulb = L4.cast(L4.Proto.Factory, ext2svr):create(getuserfs, 1000, 1000, 18); + l:startv({ caps = { - server = ext2svr, + server = ext2svr_paulb, }, log = { "client", "g" }, }, - -- program, file to create, user identifier - "rom/dstest_file_client", "home/paulb/new file", "1000"); + -- program, file to create + "rom/dstest_file_client", "home/paulb/new file"); diff -r 73649ab3a61d -r d596a1948294 tests/dstest_block_client_simple.cc --- a/tests/dstest_block_client_simple.cc Sun Aug 01 00:07:00 2021 +0200 +++ b/tests/dstest_block_client_simple.cc Sun Aug 01 00:23:08 2021 +0200 @@ -23,6 +23,7 @@ #include #include +#include #include @@ -39,13 +40,14 @@ /* Obtain filename and access parameters. */ char *filename = argv[1]; - sys_uid_t uid = argc > 2 ? atoi(argv[2]) : 0; + bool have_uid = (argc > 2) && strlen(argv[2]); + sys_uid_t uid = have_uid ? atoi(argv[2]) : 0; int repetition = argc > 3 ? atoi(argv[3]) : 10; file_t *file; /* With a user, open a user-specific file opener. */ - if (uid) + if (have_uid) { l4_cap_idx_t opener = client_open_for_user((user_t) {uid, uid, 0022}); diff -r 73649ab3a61d -r d596a1948294 tests/dstest_file_client.cc --- a/tests/dstest_file_client.cc Sun Aug 01 00:07:00 2021 +0200 +++ b/tests/dstest_file_client.cc Sun Aug 01 00:23:08 2021 +0200 @@ -142,12 +142,13 @@ } char *filename = argv[1]; - sys_uid_t uid = argc > 2 ? atoi(argv[2]) : 0; + bool have_uid = (argc > 2) && strlen(argv[2]); + sys_uid_t uid = have_uid ? atoi(argv[2]) : 0; file_t *file1, *file2; /* With a user, open a user-specific file opener. */ - if (uid) + if (have_uid) { l4_cap_idx_t opener = client_open_for_user((user_t) {uid, uid, 0022});