Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
garlick committed Mar 9, 2011
1 parent fa1c5fe commit 7596378
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
8 changes: 2 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ configure options:
munge, you will have to run the server with --no-auth
which is likely a big security vulnerability.

The 'testkern' and 'testuser' test suites will detect
whether MUNGE is installed/running and supply --no-auth
to the server automatically. Tests won't work if MUNGE
is running but diod was configured without MUNGE support.

+---------+
| Testing |
+---------+
Expand All @@ -47,7 +42,8 @@ Unit tests (make check):

Running by hand:

Starting diod server with one export, with protocol debugging:
Starting diod server with one export, no auth required,
with protocol debugging enabled:
sudo ./diod -l 192.168.50.135:550 -d 1 -n -e /tmp/9

Mounting:
Expand Down
24 changes: 9 additions & 15 deletions diodmount/diodmount.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,27 @@ Do everything but actually perform the diod mount/unmount.
.SH TESTING OPTIONS
The following options are mainly intended for testing.
.TP
.I "-s, --server CMD"
Start the \fBdiod\fR server as a child of \fBdiodmount\fR using \fICMD\fR.
It is mounted in a private namespace so there is an implicit unmount
when \fBdiodmount\fR exits. This command would normally be used with
\fI-x\fR. If \fI-u\fR is used, run CMD as USER.
.TP
.I "-x, --exec CMD"
Perform the mount(s) in a private name space, execute \fICMD\fR as a child
of \fBdiodmount\fR, then unmount and exit.
If \fI-u\fR is used, run \fICMD\fR as \fIUSER\fR.
.TP
.I "-S, --stdin"
A connection to the \fBdiod\fR server is inherited on file descriptor 0.
You must provide a dummy \fIhost\fR component of the \fIhost:aname\fR
argument.
.I "-o, --diod-options OPT,[OPT,...]"
Pass additional 9P mount options when mounting the \fBdiod\fR server.
These options override the ones \fBdiodmount\fR sets up internally.
.TP
.I "-v, --verbose"
Be verbose about what is going on.
Show an approximation of the raw \fBmount\fR command line(s).
.TP
.I "-p, --diod-port PORT"
Mount the \fBdiod\fR server on the specified port.
Do not contact \fBdiodctl\fR.
.TP
.I "-d, --v9fs-debug flag[,flag...]"
Set the specified global kernel 9p file system debug flags at mount time.
Set the specified kernel 9p file system debug flags at mount time.
The following flags are valid:
error, 9p, vfs, conv, mux, trans, slabs, fcall, fid, pkt, fsc.
These debug flags are set globally and persist after unmount.
Mounting without this option clears the kernel 9p file system debug flags.
.SH "EXAMPLES"
.LP
Mount /g/g99 from tycho42, so that all users can access it:
Expand All @@ -84,12 +79,11 @@ Mount /g/g99 from tycho42, so that all users can access it:
diodmount tycho42:/g/g99 /g/g99
.fi
.LP
Mount and unmount all file systems exported by tycho42 without updating
Mount all file systems exported by tycho42 without updating
/etc/mtab, creating mount points as needed:
.LP
.nf
diodmount -a -n -D tycho42
diodmount -U -n tycho42
.fi
.LP
Mount /p/lcrater1 on tycho[101-164] without updating /etc/mtab, starting
Expand Down
2 changes: 1 addition & 1 deletion libdiod/diod_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ _auth_write(Npfid *afid, u64 offset, u32 count, u8 *data)
memcpy (da->mungecred + offset, data, count);
da->mungecred[offset + count] = '\0';
da->mungerr = munge_decode (da->mungecred, da->mungectx, NULL, 0,
&da->mungeuid, NULL)
&da->mungeuid, NULL);
if (da->mungerr == EMUNGE_SUCCESS && afid->user->uid == da->mungeuid)
da->state = DA_VERIFIED;
#endif
Expand Down
3 changes: 2 additions & 1 deletion testkern/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
These all run the same way:
These tests all run the same way:

- Makefile sets up environment and invokes test through ./runtest wrapper.
- ./runtest mounts ./exp.d on ./mnt.d (privately) and runs test script
- output goes to <test>.out
Expand Down
8 changes: 2 additions & 6 deletions testkern/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if test $(id -u) != 0; then
echo "not root - skipping" >$TEST.out
exit 77
fi
if ! modprobe 9p; then
if ! modprobe 9p 2>/dev/null; then
echo "9p not loaded - skipping" >$TEST.out
exit 77
fi
Expand All @@ -40,12 +40,8 @@ rm -rf $PATH_EXPDIR/*
rm -f $TEST.diod $TEST.out
ulimit -c unlimited

if ! [ -x /usr/bin/munge ] || ! /usr/bin/munge -n >/dev/null 2>&1; then
AUTHARG="-n"
fi

./kconjoin \
"$PATH_DIOD $AUTHARG -d 1 -L $TEST.diod -e $PATH_EXPDIR -s $TEST.stats" \
"$PATH_DIOD -n -d 1 -L $TEST.diod -e $PATH_EXPDIR -s $TEST.stats" \
"$PATH_DIODMOUNT -S nohost:$PATH_EXPDIR $PATH_MNTDIR" \
"$TEST" \
>$TEST.out 2>&1
Expand Down
1 change: 0 additions & 1 deletion testkern/t25.exp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ testing diod file system create with setgid parent
tfsgid: file gid is different than egid and different than gid
kconjoin: t25 exited with rc=0
kconjoin: diod exited with rc=0

0 comments on commit 7596378

Please sign in to comment.