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