Unified · Split
| @@ -185,8 +185,13 @@ kickit(void) · 184 unmodified lines | |||
| 185 | // create a execcmd shadow directory | 185 | // create a execcmd shadow directory |
| 186 | spid = smprint("%ld", pid); | 186 | spid = smprint("%ld", pid); |
| 187 | fdir = createfile(fs.tree->root, spid, "exec2fs", DMDIR|0777, (void *)Xpid); | 187 | fdir = createfile(fs.tree->root, spid, "exec2fs", DMDIR|0777, (void *)Xpid); |
| 188 | free(spid); | ||
| 189 | closefile(createfile(fdir, "ctl", "exec2fs", 0666, (void *)Xpctl)); | 188 | closefile(createfile(fdir, "ctl", "exec2fs", 0666, (void *)Xpctl)); |
| 189 | |||
| 190 | closefile(createfile(fdir, "stdin", "exec2fs", 0666, (void *)Xpctl)); | ||
| 191 | closefile(createfile(fdir, "stdout", "exec2fs", 0666, (void *)Xpctl)); | ||
| 192 | closefile(createfile(fdir, "stderr", "exec2fs", 0666, (void *)Xpctl)); | ||
| 193 | |||
| 194 | free(spid); | ||
| 190 | closefile(fdir); | 195 | closefile(fdir); |
| 191 | 196 | ||
| 192 | chanfree(pidc); | 197 | chanfree(pidc); |
| @@ -260,10 +265,11 @@ fsopen(Req *r) · 67 unmodified lines | |||
| 260 | } | 265 | } |
| 261 | DPRINT(DFID, "\tctlfd=(%d)\n", e->rctlfd); | 266 | DPRINT(DFID, "\tctlfd=(%d)\n", e->rctlfd); |
| 262 | 267 | ||
| 268 | |||
| 263 | n = snprint(fname, STRMAX, "%s/%d", procpath, e->pid); | 269 | n = snprint(fname, STRMAX, "%s/%d", procpath, e->pid); |
| 264 | assert(n > 0); | 270 | assert(n > 0); |
| 265 | 271 | ||
| 266 | /* asserts are heavy handed, but help with debug */ | 272 | // asserts are heavy handed, but help with debug |
| 267 | n = mpipe(fname, "stdin"); | 273 | n = mpipe(fname, "stdin"); |
| 268 | assert(n > 0); | 274 | assert(n > 0); |
| 269 | n = mpipe(fname, "stdout"); | 275 | n = mpipe(fname, "stdout"); |
| @@ -13,7 +13,7 @@ EXECLOG=$TESTDIR/exec2fs.log · 12 unmodified lines | |||
| 13 | MPIPELOG=$TESTDIR/mpipefs.log | 13 | MPIPELOG=$TESTDIR/mpipefs.log |
| 14 | ERRORLOG=$TESTDIR/error.log | 14 | ERRORLOG=$TESTDIR/error.log |
| 15 | 15 | ||
| 16 | E_MNTPATH=/tmp/testbed/E | 16 | E_MNTPATH=$TESTDIR/E |
| 17 | 17 | ||
| 18 | # | 18 | # |
| 19 | # Cleanup Previous Instances | 19 | # Cleanup Previous Instances |
| @@ -46,13 +46,12 @@ fn startup { · 26 unmodified lines | |||
| 46 | echo Starting mpipefs.... | 46 | echo Starting mpipefs.... |
| 47 | 47 | ||
| 48 | mkdir -p $E_MNTPATH | 48 | mkdir -p $E_MNTPATH |
| 49 | mkdir -p $TESTDIR | ||
| 50 | 49 | ||
| 51 | if(~ $#* 0) { | 50 | if(~ $#* 0) { |
| 52 | ../$O.mpipefs >[2] $MPIPELOG | 51 | ../$O.mpipefs >[2] $MPIPELOG |
| 53 | } | 52 | } |
| 54 | if not { | 53 | if not { |
| 55 | ../$O.mpipefs -D -v $1 >[2] $MPIPELOG # CHATTY | 54 | ../$O.mpipefs -v $1 >[2] $MPIPELOG # CHATTY |
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | mount /srv/mpipe /n/mpipetest test | 57 | mount /srv/mpipe /n/mpipetest test |
| @@ -62,7 +61,7 @@ fn startup { · 3 unmodified lines | |||
| 62 | ../$O.exec2fs -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG | 61 | ../$O.exec2fs -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG |
| 63 | } | 62 | } |
| 64 | if not { | 63 | if not { |
| 65 | ../$O.exec2fs -D -v $1 -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG # CHATTY | 64 | ../$O.exec2fs -v $1 -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG # CHATTY |
| 66 | } | 65 | } |
| 67 | bind -bc '#p' $E_MNTPATH | 66 | bind -bc '#p' $E_MNTPATH |
| 68 | 67 | ||
| @@ -109,8 +108,6 @@ fn stdout { · 40 unmodified lines | |||
| 109 | } | 108 | } |
| 110 | 109 | ||
| 111 | echo Success! | 110 | echo Success! |
| 112 | # cleanup | ||
| 113 | rm -rf $TESTDIR/* | ||
| 114 | } | 111 | } |
| 115 | 112 | ||
| 116 | fn stdin { | 113 | fn stdin { |
| @@ -130,17 +127,18 @@ fn stdin { · 13 unmodified lines | |||
| 130 | } | 127 | } |
| 131 | 128 | ||
| 132 | echo Success! | 129 | echo Success! |
| 133 | # cleanup | ||
| 134 | rm -rf $TESTDIR/* | ||
| 135 | } | 130 | } |
| 136 | 131 | ||
| 137 | # Setup | 132 | # Setup |
| 138 | rfork | 133 | rfork |
| 139 | 134 | ||
| 140 | cleanup | 135 | cleanup |
| 141 | startup $1 | 136 | shutdown |
| 137 | |||
| 142 | testdir | 138 | testdir |
| 143 | 139 | ||
| 140 | startup $1 | ||
| 141 | |||
| 144 | # Note: the current tests die on the 4'th run of either stdout or | 142 | # Note: the current tests die on the 4'th run of either stdout or |
| 145 | # stdin. If I run cleanup**startup between each it runs fine. For | 143 | # stdin. If I run cleanup**startup between each it runs fine. For |
| 146 | # now I am leaving it at two tests and will look into it later. | 144 | # now I am leaving it at two tests and will look into it later. |