Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests update to new rump lwp/proc interfaces
details: https://anonhg.NetBSD.org/src/rev/e8c7279e00fc
branches: trunk
changeset: 757515:e8c7279e00fc
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Sep 01 19:41:27 2010 +0000
description:
update to new rump lwp/proc interfaces
diffstat:
tests/fs/common/fstest_puffs.c | 8 +++-----
tests/fs/tmpfs/t_renamerace.c | 9 ++++++---
tests/fs/vfs/t_renamerace.c | 12 ++++++++----
tests/syscall/t_cmsg.c | 10 ++++++----
4 files changed, 23 insertions(+), 16 deletions(-)
diffs (163 lines):
diff -r 133eda5641d7 -r e8c7279e00fc tests/fs/common/fstest_puffs.c
--- a/tests/fs/common/fstest_puffs.c Wed Sep 01 19:40:34 2010 +0000
+++ b/tests/fs/common/fstest_puffs.c Wed Sep 01 19:41:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fstest_puffs.c,v 1.2 2010/07/30 16:15:05 pooka Exp $ */
+/* $NetBSD: fstest_puffs.c,v 1.3 2010/09/01 19:41:27 pooka Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -72,8 +72,7 @@
phdr = (void *)buf;
preq = (void *)buf;
- /* use static thread id */
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(0);
for (;;) {
ssize_t n;
@@ -114,8 +113,7 @@
size_t toread;
int comfd, puffsfd;
- /* use static thread id */
- rump_pub_lwp_alloc_and_switch(0, 11);
+ rump_pub_lwproc_newlwp(0);
comfd = args->pta_servfd;
puffsfd = args->pta_rumpfd;
diff -r 133eda5641d7 -r e8c7279e00fc tests/fs/tmpfs/t_renamerace.c
--- a/tests/fs/tmpfs/t_renamerace.c Wed Sep 01 19:40:34 2010 +0000
+++ b/tests/fs/tmpfs/t_renamerace.c Wed Sep 01 19:41:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_renamerace.c,v 1.8 2010/07/14 21:39:31 pooka Exp $ */
+/* $NetBSD: t_renamerace.c,v 1.9 2010/09/01 19:41:27 pooka Exp $ */
/*
* Modified for rump and atf from a program supplied
@@ -33,13 +33,14 @@
}
static volatile int quittingtime = 0;
+static pid_t wrkpid;
static void *
r2w1(void *arg)
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 0);
+ rump_pub_lwproc_newlwp(wrkpid);
fd = rump_sys_open("/file", O_CREAT | O_RDWR, 0777);
if (fd == -1)
@@ -61,7 +62,7 @@
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 0);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
fd = rump_sys_open("/dir/file1", O_RDWR);
@@ -104,6 +105,8 @@
if (rump_sys_mkdir("/dir", 0777) == -1)
atf_tc_fail_errno("cannot create directory");
+ RZ(rump_pub_lwproc_newproc());
+ RL(wrkpid = rump_sys_getpid());
pthread_create(&pt[0], NULL, r2w1, NULL);
pthread_create(&pt[1], NULL, r2w2, NULL);
diff -r 133eda5641d7 -r e8c7279e00fc tests/fs/vfs/t_renamerace.c
--- a/tests/fs/vfs/t_renamerace.c Wed Sep 01 19:40:34 2010 +0000
+++ b/tests/fs/vfs/t_renamerace.c Wed Sep 01 19:41:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_renamerace.c,v 1.11 2010/08/26 18:06:44 pooka Exp $ */
+/* $NetBSD: t_renamerace.c,v 1.12 2010/09/01 19:41:28 pooka Exp $ */
/*
* Modified for rump and atf from a program supplied
@@ -25,13 +25,14 @@
#include "../../h_macros.h"
static volatile int quittingtime;
+pid_t wrkpid;
static void *
w1(void *arg)
{
int fd;
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
fd = rump_sys_open("rename.test1",
@@ -49,7 +50,7 @@
w1_dirs(void *arg)
{
- rump_pub_lwp_alloc_and_switch(0, 10);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
if (rump_sys_mkdir("rename.test1", 0777) == -1)
@@ -64,7 +65,7 @@
w2(void *arg)
{
- rump_pub_lwp_alloc_and_switch(0, 11);
+ rump_pub_lwproc_newlwp(wrkpid);
while (!quittingtime) {
rump_sys_rename("rename.test1", "rename.test2");
@@ -123,6 +124,9 @@
FSTYPE_MSDOS(tc))
atf_tc_expect_signal(-1, "PR kern/43626");
+ RZ(rump_pub_lwproc_newproc());
+ RL(wrkpid = rump_sys_getpid());
+
RL(rump_sys_chdir(mp));
pthread_create(&pt1, NULL, w1_dirs, NULL);
pthread_create(&pt2, NULL, w2, NULL);
diff -r 133eda5641d7 -r e8c7279e00fc tests/syscall/t_cmsg.c
--- a/tests/syscall/t_cmsg.c Wed Sep 01 19:40:34 2010 +0000
+++ b/tests/syscall/t_cmsg.c Wed Sep 01 19:41:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cmsg.c,v 1.14 2010/08/27 10:03:14 pgoyette Exp $ */
+/* $NetBSD: t_cmsg.c,v 1.15 2010/09/01 19:41:28 pooka Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -92,7 +92,8 @@
rump_init();
/* create first (non-proc0) process to be used in test */
- l1 = rump_pub_newproc_switch();
+ RZ(rump_pub_lwproc_newproc());
+ l1 = rump_pub_lwproc_curlwp();
/* create unix socket and bind it to a path */
memset(&sun, 0, sizeof(sun));
@@ -108,7 +109,8 @@
atf_tc_fail_errno("socket 1 listen");
/* create second process for test */
- l2 = rump_pub_newproc_switch();
+ RZ(rump_pub_lwproc_newproc());
+ l2 = rump_pub_lwproc_curlwp();
/* connect to unix domain socket */
memset(&sun, 0, sizeof(sun));
@@ -157,7 +159,7 @@
*(int *)CMSG_DATA(cmp) = -1;
/* switch back to original proc */
- rump_pub_lwp_switch(l1);
+ rump_pub_lwproc_switch(l1);
/* accept connection and read fd */
sl = sizeof(sun);
Home |
Main Index |
Thread Index |
Old Index