vos: Add the -config option
authorSimon Wilkinson <sxw@your-file-system.com>
Mon, 30 May 2011 19:14:45 +0000 (20:14 +0100)
committerDerrick Brashear <shadow@dementia.org>
Tue, 7 Jun 2011 14:46:18 +0000 (07:46 -0700)
Add the -config option to all vos commands, so that the user can set
the location of the configuration directory to use. This is primarily
provided for testing purposes, and will shortly be used to hook vos
up into the TAP-style test suite.

Change-Id: I610a3161c7d5d52ce43e77a400bc752d43f76134
Reviewed-on: http://gerrit.openafs.org/4811
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

doc/man-pages/pod1/vos.pod
src/volser/vos.c

index 2ba2068..7a32d10 100644 (file)
@@ -164,6 +164,11 @@ defined in the server machine's local F</usr/afs/etc/ThisCell> file),
 whereas a command on which the B<-cell> argument is included runs in the
 specified foreign cell.
 
+=item B<-config> <I<config directory>>
+
+The location of the directory to use to obtain configuration information,
+including the CellServDB. This is primarily provided for testing purposes.
+
 =item B<-help>
 
 Prints a command's online help message on the standard output stream. Do
index 4a931d0..adddb07 100644 (file)
@@ -78,6 +78,7 @@ cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");\
 cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
 cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
 cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses"); \
+cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL, "config location"); \
 
 #define ERROR_EXIT(code) do { \
     error = (code); \
@@ -5822,6 +5823,10 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
 #endif /* AFS_NT40_ENV */
          )
        vsu_SetCrypt(1);
+
+    if (as->parms[18].items)   /* -config flag set */
+       confdir = as->parms[18].items->data;
+
     if ((code =
         vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth,
                        &cstruct, UV_SetSecurity))) {
@@ -5838,6 +5843,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
        noresolve = 1;
     else
        noresolve = 0;
+
     return 0;
 }