[Box Backup-commit] COMMIT r2116 - in box/trunk: . bin/bbackupd bin/bbackupquery bin/bbstored infrastructure lib/backupclient lib/backupstore lib/common lib/compress lib/crypto lib/intercept lib/raidfile lib/server test/basicserver test/bbackupd test/bbackupd/testfiles test/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Fri Mar 28 22:59:28 GMT 2008


Author: chris
Date: 2008-03-28 22:59:28 +0000 (Fri, 28 Mar 2008)
New Revision: 2116

Added:
   box/trunk/.hgignore
Modified:
   box/trunk/
   box/trunk/bin/bbackupd/
   box/trunk/bin/bbackupd/BackupClientContext.cpp
   box/trunk/bin/bbackupd/BackupClientContext.h
   box/trunk/bin/bbackupd/BackupDaemon.cpp
   box/trunk/bin/bbackupquery/
   box/trunk/bin/bbackupquery/bbackupquery.cpp
   box/trunk/bin/bbstored/
   box/trunk/infrastructure/
   box/trunk/lib/backupclient/
   box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp
   box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp
   box/trunk/lib/common/
   box/trunk/lib/common/Configuration.cpp
   box/trunk/lib/common/Configuration.h
   box/trunk/lib/compress/
   box/trunk/lib/crypto/
   box/trunk/lib/intercept/
   box/trunk/lib/raidfile/
   box/trunk/lib/raidfile/RaidFileController.cpp
   box/trunk/lib/server/
   box/trunk/lib/server/Daemon.h
   box/trunk/lib/server/ServerStream.h
   box/trunk/lib/server/ServerTLS.h
   box/trunk/test/basicserver/
   box/trunk/test/basicserver/testbasicserver.cpp
   box/trunk/test/bbackupd/testbbackupd.cpp
   box/trunk/test/bbackupd/testfiles/
   box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf
   box/trunk/test/bbackupd/testfiles/bbackupd.conf.in
   box/trunk/test/bbackupd/testfiles/bbstored.conf
   box/trunk/test/common/testcommon.cpp
Log:
Allow configuration of the server port that the client will connect to 
(bbackupd and bbackupquery).

Redesign ConfigurationVerify to use classes instead of structs.

Use port 22011 instead of 2201 during tests, to reduce the chances of 
conflicting with a running bbstored or other process.

Ignore autogen_* in svn:ignore everywhere instead of individual per-file 
ignores.



Property changes on: box/trunk
___________________________________________________________________
Name: svn:ignore
   - aclocal.m4
autom4te.cache
config.log
config.status
configure
debug
ExceptionCodes.txt
local
Makefile
parcels
release
runtest.pl

   + aclocal.m4
autom4te.cache
config.log
config.status
configure
debug
ExceptionCodes.txt
local
Makefile
parcels
release
runtest.pl
.hg


Added: box/trunk/.hgignore
===================================================================
--- box/trunk/.hgignore	                        (rev 0)
+++ box/trunk/.hgignore	2008-03-28 22:59:28 UTC (rev 2116)
@@ -0,0 +1,37 @@
+.svn
+BoxConfig.h
+BoxConfig.h.in
+BoxPlatform.pm
+BoxPortsAndFiles.h
+ExceptionCodes.txt
+Makefile
+_main.cpp
+_t
+_t-gdb
+aclocal.m4
+autogen_*
+autom4te.cache
+bbackupd-config
+bbackupd.conf
+bbstored-certs
+bbstored-config
+config.log
+config.status
+configure
+debug
+extcheck1.pl
+extcheck2.pl
+local
+makebuildenv.pl
+makedistribution.pl
+makedocumentation.pl
+makeexception.pl
+makeparcels.pl
+makeprotocol.pl
+notifyscript.pl
+parcels
+raidfile-config
+release
+runtest.pl
+syncallowscript.pl
+testbackupstorefix.pl


Property changes on: box/trunk/bin/bbackupd
___________________________________________________________________
Name: svn:ignore
   - Makefile
bbackupd-config

   + Makefile
bbackupd-config
autogen_*


Modified: box/trunk/bin/bbackupd/BackupClientContext.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupClientContext.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/bin/bbackupd/BackupClientContext.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -44,6 +44,7 @@
 	BackupDaemon &rDaemon, 
 	TLSContext &rTLSContext, 
 	const std::string &rHostname,
+	int Port,
 	int32_t AccountNumber, 
 	bool ExtendedLogging,
 	bool ExtendedLogToFile,
@@ -52,6 +53,7 @@
 	: mrDaemon(rDaemon),
 	  mrTLSContext(rTLSContext),
 	  mHostname(rHostname),
+	  mPort(Port),
 	  mAccountNumber(AccountNumber),
 	  mpSocket(0),
 	  mpConnection(0),
@@ -129,7 +131,8 @@
 			mHostname << "'...");
 
 		// Connect!
-		mpSocket->Open(mrTLSContext, Socket::TypeINET, mHostname.c_str(), BOX_PORT_BBSTORED);
+		mpSocket->Open(mrTLSContext, Socket::TypeINET,
+			mHostname.c_str(), mPort);
 		
 		// And create a procotol object
 		mpConnection = new BackupProtocolClient(*mpSocket);

Modified: box/trunk/bin/bbackupd/BackupClientContext.h
===================================================================
--- box/trunk/bin/bbackupd/BackupClientContext.h	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/bin/bbackupd/BackupClientContext.h	2008-03-28 22:59:28 UTC (rev 2116)
@@ -41,6 +41,7 @@
 		BackupDaemon &rDaemon, 
 		TLSContext &rTLSContext, 
 		const std::string &rHostname,
+		int32_t Port,
 		int32_t AccountNumber, 
 		bool ExtendedLogging,
 		bool ExtendedLogToFile,
@@ -201,6 +202,7 @@
 	BackupDaemon &mrDaemon;
 	TLSContext &mrTLSContext;
 	std::string mHostname;
+	int mPort;
 	int32_t mAccountNumber;
 	SocketStreamTLS *mpSocket;
 	BackupProtocolClient *mpConnection;

Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/bin/bbackupd/BackupDaemon.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -958,6 +958,7 @@
 					*this, 
 					tlsContext, 
 					conf.GetKeyValue("StoreHostname"),
+					conf.GetKeyValueInt("StorePort"),
 					conf.GetKeyValueInt("AccountNumber"), 
 					conf.GetKeyValueBool("ExtendedLogging"),
 					conf.KeyExists("ExtendedLogFile"),


Property changes on: box/trunk/bin/bbackupquery
___________________________________________________________________
Name: svn:ignore
   - autogen_Documentation.cpp
Makefile
makedocumentation.pl

   + autogen_*
Makefile
makedocumentation.pl


Modified: box/trunk/bin/bbackupquery/bbackupquery.cpp
===================================================================
--- box/trunk/bin/bbackupquery/bbackupquery.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/bin/bbackupquery/bbackupquery.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -260,7 +260,9 @@
 	// 2. Connect to server
 	if(!quiet) BOX_INFO("Connecting to store...");
 	SocketStreamTLS socket;
-	socket.Open(tlsContext, Socket::TypeINET, conf.GetKeyValue("StoreHostname").c_str(), BOX_PORT_BBSTORED);
+	socket.Open(tlsContext, Socket::TypeINET,
+		conf.GetKeyValue("StoreHostname").c_str(),
+		conf.GetKeyValueInt("StorePort"));
 	
 	// 3. Make a protocol, and handshake
 	if(!quiet) BOX_INFO("Handshake with store...");


Property changes on: box/trunk/bin/bbstored
___________________________________________________________________
Name: svn:ignore
   - autogen_BackupProtocolServer.cpp
autogen_BackupProtocolServer.h
Makefile
bbstored-certs
bbstored-config

   + autogen_*
Makefile
bbstored-certs
bbstored-config



Property changes on: box/trunk/infrastructure
___________________________________________________________________
Name: svn:ignore
   - BoxPlatform.pm
makebuildenv.pl
makeparcels.pl

   + BoxPlatform.pm
makebuildenv.pl
makeparcels.pl
makedistribution.pl



Property changes on: box/trunk/lib/backupclient
___________________________________________________________________
Name: svn:ignore
   - autogen_BackupProtocolClient.cpp
autogen_BackupProtocolClient.h
autogen_BackupStoreException.cpp
autogen_BackupStoreException.h
Makefile

   + autogen_*
Makefile


Modified: box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp
===================================================================
--- box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -17,15 +17,15 @@
 
 static const ConfigurationVerifyKey backuplocationkeys[] = 
 {
-	{"ExcludeFile", 0, ConfigTest_MultiValueAllowed, 0},
-	{"ExcludeFilesRegex", 0, ConfigTest_MultiValueAllowed, 0},
-	{"ExcludeDir", 0, ConfigTest_MultiValueAllowed, 0},
-	{"ExcludeDirsRegex", 0, ConfigTest_MultiValueAllowed, 0},
-	{"AlwaysIncludeFile", 0, ConfigTest_MultiValueAllowed, 0},
-	{"AlwaysIncludeFilesRegex", 0, ConfigTest_MultiValueAllowed, 0},
-	{"AlwaysIncludeDir", 0, ConfigTest_MultiValueAllowed, 0},
-	{"AlwaysIncludeDirsRegex", 0, ConfigTest_MultiValueAllowed, 0},
-	{"Path", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("ExcludeFile", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("ExcludeFilesRegex", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("ExcludeDir", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("ExcludeDirsRegex", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("AlwaysIncludeFile", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("AlwaysIncludeFilesRegex", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("AlwaysIncludeDir", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("AlwaysIncludeDirsRegex", ConfigTest_MultiValueAllowed),
+	ConfigurationVerifyKey("Path", ConfigTest_Exists | ConfigTest_LastEntry)
 };
 
 static const ConfigurationVerify backuplocations[] = 
@@ -64,39 +64,54 @@
 
 static const ConfigurationVerifyKey verifyrootkeys[] = 
 {
-	{"AccountNumber", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-
-	{"UpdateStoreInterval", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"MinimumFileAge", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"MaxUploadWait", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"MaxFileTimeInFuture", "172800", ConfigTest_IsInt, 0},		// file is uploaded if the file is this much in the future (2 days default)
-
-	{"AutomaticBackup", "yes", ConfigTest_IsBool, 0},
+	ConfigurationVerifyKey("AccountNumber",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("UpdateStoreInterval",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("MinimumFileAge",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("MaxUploadWait",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("MaxFileTimeInFuture", ConfigTest_IsInt, 172800),
+	// file is uploaded if the file is this much in the future
+	// (2 days default)
+	ConfigurationVerifyKey("AutomaticBackup", ConfigTest_IsBool, true),
 	
-	{"SyncAllowScript", 0, 0, 0},			// optional script to run to see if the sync should be started now
-				// return "now" if it's allowed, or a number of seconds if it's not
+	ConfigurationVerifyKey("SyncAllowScript", 0),
+	// script that returns "now" if backup is allowed now, or a number
+	// of seconds to wait before trying again if not
 
-	{"MaximumDiffingTime", 0, ConfigTest_IsInt, 0},
-	{"DeleteRedundantLocationsAfter", "172800", ConfigTest_IsInt, 0},
+	ConfigurationVerifyKey("MaximumDiffingTime", ConfigTest_IsInt),
+	ConfigurationVerifyKey("DeleteRedundantLocationsAfter",
+		ConfigTest_IsInt, 172800),
 
-	{"FileTrackingSizeThreshold", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"DiffingUploadSizeThreshold", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"StoreHostname", 0, ConfigTest_Exists, 0},
-	{"ExtendedLogging",	"no", ConfigTest_IsBool, 0}, // extended log to syslog
-	{"ExtendedLogFile",	NULL, 0, 0}, // extended log to a file
-	{"LogAllFileAccess", "no", ConfigTest_IsBool, 0},
+	ConfigurationVerifyKey("FileTrackingSizeThreshold", 
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("DiffingUploadSizeThreshold",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("StoreHostname", ConfigTest_Exists),
+	ConfigurationVerifyKey("StorePort", ConfigTest_IsInt,
+		BOX_PORT_BBSTORED),
+	ConfigurationVerifyKey("ExtendedLogging", ConfigTest_IsBool, false),
+	// extended log to syslog
+	ConfigurationVerifyKey("ExtendedLogFile", 0),
+	// extended log to a file
+	ConfigurationVerifyKey("LogAllFileAccess", ConfigTest_IsBool, false),
+	ConfigurationVerifyKey("CommandSocket", 0),
+	// not compulsory to have this
+	ConfigurationVerifyKey("KeepAliveTime", ConfigTest_IsInt),
+ 	ConfigurationVerifyKey("StoreObjectInfoFile", 0),
+	// optional
 
-	{"CommandSocket", 0, 0, 0},				// not compulsory to have this
-	{"KeepAliveTime", 0, ConfigTest_IsInt, 0},				// optional
- 	{"StoreObjectInfoFile", 0, 0, 0},				// optional
-
-	{"NotifyScript", 0, 0, 0},				// optional script to run when backup needs attention, eg store full
+	ConfigurationVerifyKey("NotifyScript", 0),
+	// optional script to run when backup needs attention, eg store full
 	
-	{"CertificateFile", 0, ConfigTest_Exists, 0},
-	{"PrivateKeyFile", 0, ConfigTest_Exists, 0},
-	{"TrustedCAsFile", 0, ConfigTest_Exists, 0},
-	{"KeysFile", 0, ConfigTest_Exists, 0},
-	{"DataDirectory", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("CertificateFile", ConfigTest_Exists),
+	ConfigurationVerifyKey("PrivateKeyFile", ConfigTest_Exists),
+	ConfigurationVerifyKey("TrustedCAsFile", ConfigTest_Exists),
+	ConfigurationVerifyKey("KeysFile", ConfigTest_Exists),
+	ConfigurationVerifyKey("DataDirectory", 
+		ConfigTest_Exists | ConfigTest_LastEntry),
 };
 
 const ConfigurationVerify BackupDaemonConfigVerify =

Modified: box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp
===================================================================
--- box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/backupstore/BackupStoreConfigVerify.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -16,7 +16,8 @@
 
 static const ConfigurationVerifyKey verifyserverkeys[] = 
 {
-	SERVERTLS_VERIFY_SERVER_KEYS(0)	// no default listen addresses
+	SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue)
+	// no default listen addresses
 };
 
 static const ConfigurationVerify verifyserver[] = 
@@ -32,16 +33,18 @@
 
 static const ConfigurationVerifyKey verifyrootkeys[] = 
 {
-	{"AccountDatabase",	0, ConfigTest_Exists, 0},
-	{"TimeBetweenHousekeeping",	0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"ExtendedLogging",	"no", ConfigTest_IsBool, 0},			// make value "yes" to enable in config file
+	ConfigurationVerifyKey("AccountDatabase", ConfigTest_Exists),
+	ConfigurationVerifyKey("TimeBetweenHousekeeping",
+		ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("ExtendedLogging", ConfigTest_IsBool, false),
+	// make value "yes" to enable in config file
 
 	#ifdef WIN32
-		{"RaidFileConf", "", ConfigTest_LastEntry, 0}
+		ConfigurationVerifyKey("RaidFileConf", ConfigTest_LastEntry)
 	#else
-		{"RaidFileConf", BOX_FILE_RAIDFILE_DEFAULT_CONFIG, ConfigTest_LastEntry, 0}
+		ConfigurationVerifyKey("RaidFileConf", ConfigTest_LastEntry,
+			BOX_FILE_RAIDFILE_DEFAULT_CONFIG)
 	#endif
-
 };
 
 const ConfigurationVerify BackupConfigFileVerify =


Property changes on: box/trunk/lib/common
___________________________________________________________________
Name: svn:ignore
   - autogen_CommonException.cpp
autogen_CommonException.h
autogen_ConversionException.cpp
autogen_ConversionException.h
BoxConfig.h
BoxConfig.h.in
Makefile
makeexception.pl

   + autogen_*
BoxConfig.h
BoxConfig.h.in
Makefile
makeexception.pl
BoxPortsAndFiles.h


Modified: box/trunk/lib/common/Configuration.cpp
===================================================================
--- box/trunk/lib/common/Configuration.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/common/Configuration.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -12,6 +12,8 @@
 #include <stdlib.h>
 #include <limits.h>
 
+#include <sstream>
+
 #include "Configuration.h"
 #include "CommonException.h"
 #include "Guards.h"
@@ -29,8 +31,106 @@
 static const char *sValueBooleanStrings[] = {"yes", "true", "no", "false", 0};
 static const bool sValueBooleanValue[] = {true, true, false, false};
 
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	void *testFunction
+)
+: mName(name),
+  mHasDefaultValue(false),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{ }
 
+// to allow passing NULL for default ListenAddresses
 
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	NoDefaultValue_t t,
+	void *testFunction
+)
+: mName(name),
+  mHasDefaultValue(false),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{ }
+
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	std::string defaultValue,
+	void *testFunction
+)
+: mName(name),
+  mDefaultValue(defaultValue),
+  mHasDefaultValue(true),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{ }
+
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	const char *defaultValue,
+	void *testFunction
+)
+: mName(name),
+  mDefaultValue(defaultValue),
+  mHasDefaultValue(true),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{ }
+
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	int defaultValue,
+	void *testFunction
+)
+: mName(name),
+  mHasDefaultValue(true),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{
+	ASSERT(flags & ConfigTest_IsInt);
+	std::ostringstream val;
+	val << defaultValue;
+	mDefaultValue = val.str();
+}
+
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	std::string name,
+	int flags,
+	bool defaultValue,
+	void *testFunction
+)
+: mName(name),
+  mHasDefaultValue(true),
+  mFlags(flags),
+  mTestFunction(testFunction)
+{
+	ASSERT(flags & ConfigTest_IsBool);
+	mDefaultValue = defaultValue ? "yes" : "no";
+}
+
+ConfigurationVerifyKey::ConfigurationVerifyKey
+(
+	const ConfigurationVerifyKey& rToCopy
+)
+: mName(rToCopy.mName),
+  mDefaultValue(rToCopy.mDefaultValue),
+  mHasDefaultValue(rToCopy.mHasDefaultValue),
+  mFlags(rToCopy.mFlags),
+  mTestFunction(rToCopy.mTestFunction)
+{ }
+
 // --------------------------------------------------------------------------
 //
 // Function
@@ -120,8 +220,8 @@
 		{
 			if(!Verify(*pconfig, *pVerify, std::string(), rErrorMsg))
 			{
-				//TRACE1("Error message from Verify: %s", rErrorMsg.c_str());
-				TRACE0("Error at Configuration::Verify\n");
+				BOX_ERROR("Error verifying configuration: " <<
+					rErrorMsg);
 				delete pconfig;
 				pconfig = 0;
 				return std::auto_ptr<Configuration>(0);
@@ -189,7 +289,8 @@
 			}
 			else
 			{
-				rErrorMsg += "Unexpected start block in " + rConfig.mName + "\n";
+				rErrorMsg += "Unexpected start block in " +
+					rConfig.mName + "\n";
 			}
 		}
 		else
@@ -290,36 +391,32 @@
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::KeyExists(const char *)
+//		Name:    Configuration::KeyExists(const std::string&)
 //		Purpose: Checks to see if a key exists
 //		Created: 2003/07/23
 //
 // --------------------------------------------------------------------------
-bool Configuration::KeyExists(const char *pKeyName) const
+bool Configuration::KeyExists(const std::string& rKeyName) const
 {
-	if(pKeyName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
-	return mKeys.find(pKeyName) != mKeys.end();
+	return mKeys.find(rKeyName) != mKeys.end();
 }
 
 
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::GetKeyValue(const char *)
+//		Name:    Configuration::GetKeyValue(const std::string&)
 //		Purpose: Returns the value of a configuration variable
 //		Created: 2003/07/23
 //
 // --------------------------------------------------------------------------
-const std::string &Configuration::GetKeyValue(const char *pKeyName) const
+const std::string &Configuration::GetKeyValue(const std::string& rKeyName) const
 {
-	if(pKeyName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
-	std::map<std::string, std::string>::const_iterator i(mKeys.find(pKeyName));
+	std::map<std::string, std::string>::const_iterator i(mKeys.find(rKeyName));
 	
 	if(i == mKeys.end())
 	{
-		BOX_ERROR("Missing configuration key: " << pKeyName);
+		BOX_ERROR("Missing configuration key: " << rKeyName);
 		THROW_EXCEPTION(CommonException, ConfigNoKey)
 	}
 	else
@@ -332,16 +429,14 @@
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::GetKeyValueInt(const char *)
+//		Name:    Configuration::GetKeyValueInt(const std::string& rKeyName)
 //		Purpose: Gets a key value as an integer
 //		Created: 2003/07/23
 //
 // --------------------------------------------------------------------------
-int Configuration::GetKeyValueInt(const char *pKeyName) const
+int Configuration::GetKeyValueInt(const std::string& rKeyName) const
 {
-	if(pKeyName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
-	std::map<std::string, std::string>::const_iterator i(mKeys.find(pKeyName));
+	std::map<std::string, std::string>::const_iterator i(mKeys.find(rKeyName));
 	
 	if(i == mKeys.end())
 	{
@@ -362,16 +457,14 @@
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::GetKeyValueBool(const char *) const
+//		Name:    Configuration::GetKeyValueBool(const std::string&)
 //		Purpose: Gets a key value as a boolean
 //		Created: 17/2/04
 //
 // --------------------------------------------------------------------------
-bool Configuration::GetKeyValueBool(const char *pKeyName) const
+bool Configuration::GetKeyValueBool(const std::string& rKeyName) const
 {
-	if(pKeyName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
-	std::map<std::string, std::string>::const_iterator i(mKeys.find(pKeyName));
+	std::map<std::string, std::string>::const_iterator i(mKeys.find(rKeyName));
 	
 	if(i == mKeys.end())
 	{
@@ -428,22 +521,21 @@
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::SubConfigurationExists(const char *)
+//		Name:    Configuration::SubConfigurationExists(const
+//			 std::string&)
 //		Purpose: Checks to see if a sub configuration exists
 //		Created: 2003/07/23
 //
 // --------------------------------------------------------------------------
-bool Configuration::SubConfigurationExists(const char *pSubName) const
+bool Configuration::SubConfigurationExists(const std::string& rSubName) const
 {
-	if(pSubName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
 	// Attempt to find it...
 	std::list<std::pair<std::string, Configuration> >::const_iterator i(mSubConfigurations.begin());
 	
 	for(; i != mSubConfigurations.end(); ++i)
 	{
 		// This the one?
-		if(i->first == pSubName)
+		if(i->first == rSubName)
 		{
 			// Yes.
 			return true;
@@ -458,22 +550,22 @@
 // --------------------------------------------------------------------------
 //
 // Function
-//		Name:    Configuration::GetSubConfiguration(const char *)
+//		Name:    Configuration::GetSubConfiguration(const
+//			 std::string&)
 //		Purpose: Gets a sub configuration
 //		Created: 2003/07/23
 //
 // --------------------------------------------------------------------------
-const Configuration &Configuration::GetSubConfiguration(const char *pSubName) const
+const Configuration &Configuration::GetSubConfiguration(const std::string&
+	rSubName) const
 {
-	if(pSubName == 0) {THROW_EXCEPTION(CommonException, BadArguments)}
-
 	// Attempt to find it...
 	std::list<std::pair<std::string, Configuration> >::const_iterator i(mSubConfigurations.begin());
 	
 	for(; i != mSubConfigurations.end(); ++i)
 	{
 		// This the one?
-		if(i->first == pSubName)
+		if(i->first == rSubName)
 		{
 			// Yes.
 			return i->second;
@@ -528,15 +620,14 @@
 		do
 		{
 			// Can the key be found?
-			ASSERT(pvkey->mpName);
-			if(rConfig.KeyExists(pvkey->mpName))
+			if(rConfig.KeyExists(pvkey->Name()))
 			{
 				// Get value
-				const std::string &rval = rConfig.GetKeyValue(pvkey->mpName);
+				const std::string &rval = rConfig.GetKeyValue(pvkey->Name());
 				const char *val = rval.c_str();
 
 				// Check it's a number?
-				if((pvkey->Tests & ConfigTest_IsInt) == ConfigTest_IsInt)
+				if((pvkey->Flags() & ConfigTest_IsInt) == ConfigTest_IsInt)
 				{					
 					// Test it...
 					char *end;
@@ -545,12 +636,12 @@
 					{
 						// not a good value
 						ok = false;
-						rErrorMsg += rLevel + rConfig.mName +"." + pvkey->mpName + " (key) is not a valid integer.\n";
+						rErrorMsg += rLevel + rConfig.mName + "." + pvkey->Name() + " (key) is not a valid integer.\n";
 					}
 				}
 				
 				// Check it's a bool?
-				if((pvkey->Tests & ConfigTest_IsBool) == ConfigTest_IsBool)
+				if((pvkey->Flags() & ConfigTest_IsBool) == ConfigTest_IsBool)
 				{				
 					// See if it's one of the allowed strings.
 					bool found = false;
@@ -568,37 +659,38 @@
 					if(!found)
 					{
 						ok = false;
-						rErrorMsg += rLevel + rConfig.mName +"." + pvkey->mpName + " (key) is not a valid boolean value.\n";
+						rErrorMsg += rLevel + rConfig.mName + "." + pvkey->Name() + " (key) is not a valid boolean value.\n";
 					}
 				}
 				
 				// Check for multi valued statments where they're not allowed
-				if((pvkey->Tests & ConfigTest_MultiValueAllowed) == 0)
+				if((pvkey->Flags() & ConfigTest_MultiValueAllowed) == 0)
 				{
 					// Check to see if this key is a multi-value -- it shouldn't be
 					if(rval.find(MultiValueSeparator) != rval.npos)
 					{
 						ok = false;
-						rErrorMsg += rLevel + rConfig.mName +"." + pvkey->mpName + " (key) multi value not allowed (duplicated key?).\n";
+						rErrorMsg += rLevel + rConfig.mName +"." + pvkey->Name() + " (key) multi value not allowed (duplicated key?).\n";
 					}
 				}				
 			}
 			else
 			{
 				// Is it required to exist?
-				if((pvkey->Tests & ConfigTest_Exists) == ConfigTest_Exists)
+				if((pvkey->Flags() & ConfigTest_Exists) == ConfigTest_Exists)
 				{
 					// Should exist, but doesn't.
 					ok = false;
-					rErrorMsg += rLevel + rConfig.mName + "." + pvkey->mpName + " (key) is missing.\n";
+					rErrorMsg += rLevel + rConfig.mName + "." + pvkey->Name() + " (key) is missing.\n";
 				}
-				else if(pvkey->mpDefaultValue)
+				else if(pvkey->HasDefaultValue())
 				{
-					rConfig.mKeys[std::string(pvkey->mpName)] = std::string(pvkey->mpDefaultValue);
+					rConfig.mKeys[pvkey->Name()] =
+						pvkey->DefaultValue();
 				}
 			}
 		
-			if((pvkey->Tests & ConfigTest_LastEntry) == ConfigTest_LastEntry)
+			if((pvkey->Flags() & ConfigTest_LastEntry) == ConfigTest_LastEntry)
 			{
 				// No more!
 				todo = false;
@@ -618,14 +710,14 @@
 			bool found = false;
 			while(scan)
 			{
-				if(scan->mpName == i->first)
+				if(scan->Name() == i->first)
 				{
 					found = true;
 					break;
 				}
 				
 				// Next?
-				if((scan->Tests & ConfigTest_LastEntry) == ConfigTest_LastEntry)
+				if((scan->Flags() & ConfigTest_LastEntry) == ConfigTest_LastEntry)
 				{
 					break;
 				}
@@ -650,8 +742,7 @@
 		const ConfigurationVerify *scan = rVerify.mpSubConfigurations;
 		while(scan)
 		{
-			ASSERT(scan->mpName);
-			if(scan->mpName[0] == '*')
+			if(scan->mName.length() > 0 && scan->mName[0] == '*')
 			{
 				wildcardverify = scan;
 			}
@@ -659,7 +750,8 @@
 			// Required?
 			if((scan->Tests & ConfigTest_Exists) == ConfigTest_Exists)
 			{
-				if(scan->mpName[0] == '*')
+				if(scan->mName.length() > 0 &&
+					scan->mName[0] == '*')
 				{
 					// Check something exists
 					if(rConfig.mSubConfigurations.size() < 1)
@@ -672,11 +764,11 @@
 				else
 				{
 					// Check real thing exists
-					if(!rConfig.SubConfigurationExists(scan->mpName))
+					if(!rConfig.SubConfigurationExists(scan->mName))
 					{
 						// Should exist, but doesn't.
 						ok = false;
-						rErrorMsg += rLevel + rConfig.mName + "." + scan->mpName + " (block) is missing.\n";
+						rErrorMsg += rLevel + rConfig.mName + "." + scan->mName + " (block) is missing.\n";
 					}
 				}
 			}
@@ -701,7 +793,7 @@
 			ASSERT(name);
 			while(scan)
 			{
-				if(strcmp(scan->mpName, name) == 0)
+				if(scan->mName == name)
 				{
 					// found it!
 					subverify = scan;

Modified: box/trunk/lib/common/Configuration.h
===================================================================
--- box/trunk/lib/common/Configuration.h	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/common/Configuration.h	2008-03-28 22:59:28 UTC (rev 2116)
@@ -29,20 +29,51 @@
 class ConfigurationVerifyKey
 {
 public:
-	const char *mpName;			// "*" for all other keys (not implemented yet)
-	const char *mpDefaultValue;	// default for when it's not present
-	int Tests;
-	void *TestFunction;			// set to zero for now, will implement later
+	typedef enum
+	{
+		NoDefaultValue = 1
+	} NoDefaultValue_t;
+
+	ConfigurationVerifyKey(std::string name, int flags,
+		void *testFunction = NULL);
+	// to allow passing ConfigurationVerifyKey::NoDefaultValue
+	// for default ListenAddresses
+	ConfigurationVerifyKey(std::string name, int flags,
+		NoDefaultValue_t t, void *testFunction = NULL);
+	ConfigurationVerifyKey(std::string name, int flags,
+		std::string defaultValue, void *testFunction = NULL);
+	ConfigurationVerifyKey(std::string name, int flags,
+		const char* defaultValue, void *testFunction = NULL);
+	ConfigurationVerifyKey(std::string name, int flags,
+		int defaultValue, void *testFunction = NULL);
+	ConfigurationVerifyKey(std::string name, int flags,
+		bool defaultValue, void *testFunction = NULL);
+	const std::string& Name() const { return mName; }
+	const std::string& DefaultValue() const { return mDefaultValue; }
+	const bool HasDefaultValue() const { return mHasDefaultValue; }
+	const int Flags() const { return mFlags; }
+	const void* TestFunction() const { return mTestFunction; }
+	ConfigurationVerifyKey(const ConfigurationVerifyKey& rToCopy);
+
+private:
+	ConfigurationVerifyKey& operator=(const ConfigurationVerifyKey&
+		noAssign);
+
+	std::string mName;         // "*" for all other keys (not implemented yet)
+	std::string mDefaultValue; // default for when it's not present
+	bool mHasDefaultValue;
+	int mFlags;
+	void *mTestFunction; // set to zero for now, will implement later
 };
 
 class ConfigurationVerify
 {
 public:
-	const char *mpName;			// "*" for all other sub config names
+	std::string mName; // "*" for all other sub config names
 	const ConfigurationVerify *mpSubConfigurations;
 	const ConfigurationVerifyKey *mpKeys;
 	int Tests;	
-	void *TestFunction;			// set to zero for now, will implement later
+	void *TestFunction; // set to zero for now, will implement later
 };
 
 class FdGetLine;
@@ -79,14 +110,14 @@
 		std::string &rErrorMsg)
 	{ return LoadAndVerify(rFilename, 0, rErrorMsg); }
 	
-	bool KeyExists(const char *pKeyName) const;
-	const std::string &GetKeyValue(const char *pKeyName) const;
-	int GetKeyValueInt(const char *pKeyName) const;
-	bool GetKeyValueBool(const char *pKeyName) const;
+	bool KeyExists(const std::string& rKeyName) const;
+	const std::string &GetKeyValue(const std::string& rKeyName) const;
+	int GetKeyValueInt(const std::string& rKeyName) const;
+	bool GetKeyValueBool(const std::string& rKeyName) const;
 	std::vector<std::string> GetKeyNames() const;
 	
-	bool SubConfigurationExists(const char *pSubName) const;
-	const Configuration &GetSubConfiguration(const char *pSubName) const;
+	bool SubConfigurationExists(const std::string& rSubName) const;
+	const Configuration &GetSubConfiguration(const std::string& rSubName) const;
 	std::vector<std::string> GetSubConfigurationNames() const;
 	
 	std::string mName;


Property changes on: box/trunk/lib/compress
___________________________________________________________________
Name: svn:ignore
   - autogen_CompressException.cpp
autogen_CompressException.h
Makefile

   + autogen_*
Makefile



Property changes on: box/trunk/lib/crypto
___________________________________________________________________
Name: svn:ignore
   - autogen_CipherException.cpp
autogen_CipherException.h
Makefile

   + autogen_*
Makefile



Property changes on: box/trunk/lib/intercept
___________________________________________________________________
Name: svn:ignore
   + Makefile



Property changes on: box/trunk/lib/raidfile
___________________________________________________________________
Name: svn:ignore
   - autogen_RaidFileException.cpp
autogen_RaidFileException.h
Makefile
raidfile-config

   + autogen_*
Makefile
raidfile-config


Modified: box/trunk/lib/raidfile/RaidFileController.cpp
===================================================================
--- box/trunk/lib/raidfile/RaidFileController.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/raidfile/RaidFileController.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -70,11 +70,14 @@
 
 	static const ConfigurationVerifyKey verifykeys[] =
 	{
-		{"SetNumber",	0,	ConfigTest_Exists | ConfigTest_IsInt, 0},
-		{"BlockSize",	0,	ConfigTest_Exists | ConfigTest_IsInt, 0},
-		{"Dir0", 		0,	ConfigTest_Exists, 0},
-		{"Dir1", 		0,	ConfigTest_Exists, 0},
-		{"Dir2", 		0,	ConfigTest_Exists | ConfigTest_LastEntry, 0}
+		ConfigurationVerifyKey("SetNumber",
+			ConfigTest_Exists | ConfigTest_IsInt),
+		ConfigurationVerifyKey("BlockSize",
+			ConfigTest_Exists | ConfigTest_IsInt),
+		ConfigurationVerifyKey("Dir0", ConfigTest_Exists),
+		ConfigurationVerifyKey("Dir1", ConfigTest_Exists),
+		ConfigurationVerifyKey("Dir2",
+			ConfigTest_Exists | ConfigTest_LastEntry)
 	};
 	
 	static const ConfigurationVerify subverify = 


Property changes on: box/trunk/lib/server
___________________________________________________________________
Name: svn:ignore
   - autogen_ConnectionException.cpp
autogen_ConnectionException.h
autogen_ServerException.cpp
autogen_ServerException.h
Makefile
makeprotocol.pl

   + autogen_*
Makefile
makeprotocol.pl


Modified: box/trunk/lib/server/Daemon.h
===================================================================
--- box/trunk/lib/server/Daemon.h	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/server/Daemon.h	2008-03-28 22:59:28 UTC (rev 2116)
@@ -92,8 +92,9 @@
 	std::string mAppName;
 };
 
-#define DAEMON_VERIFY_SERVER_KEYS 	{"PidFile", 0, ConfigTest_Exists, 0}, \
-									{"User", 0, ConfigTest_LastEntry, 0}
+#define DAEMON_VERIFY_SERVER_KEYS \
+	ConfigurationVerifyKey("PidFile", ConfigTest_Exists), \
+	ConfigurationVerifyKey("User", ConfigTest_LastEntry)
 
 #endif // DAEMON__H
 

Modified: box/trunk/lib/server/ServerStream.h
===================================================================
--- box/trunk/lib/server/ServerStream.h	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/server/ServerStream.h	2008-03-28 22:59:28 UTC (rev 2116)
@@ -365,8 +365,8 @@
 };
 
 #define SERVERSTREAM_VERIFY_SERVER_KEYS(DEFAULT_ADDRESSES) \
-											{"ListenAddresses", DEFAULT_ADDRESSES, 0, 0}, \
-											DAEMON_VERIFY_SERVER_KEYS 
+	ConfigurationVerifyKey("ListenAddresses", 0, DEFAULT_ADDRESSES), \
+	DAEMON_VERIFY_SERVER_KEYS 
 
 #include "MemLeakFindOff.h"
 

Modified: box/trunk/lib/server/ServerTLS.h
===================================================================
--- box/trunk/lib/server/ServerTLS.h	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/lib/server/ServerTLS.h	2008-03-28 22:59:28 UTC (rev 2116)
@@ -70,11 +70,10 @@
 };
 
 #define SERVERTLS_VERIFY_SERVER_KEYS(DEFAULT_ADDRESSES) \
-											{"CertificateFile", 0, ConfigTest_Exists, 0}, \
-											{"PrivateKeyFile", 0, ConfigTest_Exists, 0}, \
-											{"TrustedCAsFile", 0, ConfigTest_Exists, 0}, \
-											SERVERSTREAM_VERIFY_SERVER_KEYS(DEFAULT_ADDRESSES)
+	ConfigurationVerifyKey("CertificateFile", ConfigTest_Exists), \
+	ConfigurationVerifyKey("PrivateKeyFile", ConfigTest_Exists), \
+	ConfigurationVerifyKey("TrustedCAsFile", ConfigTest_Exists), \
+	SERVERSTREAM_VERIFY_SERVER_KEYS(DEFAULT_ADDRESSES)
 
-
 #endif // SERVERTLS__H
 


Property changes on: box/trunk/test/basicserver
___________________________________________________________________
Name: svn:ignore
   - autogen_TestProtocolClient.cpp
autogen_TestProtocolClient.h
autogen_TestProtocolServer.cpp
autogen_TestProtocolServer.h
_main.cpp
Makefile
_t
_t-gdb

   + autogen_*
_main.cpp
Makefile
_t
_t-gdb


Modified: box/trunk/test/basicserver/testbasicserver.cpp
===================================================================
--- box/trunk/test/basicserver/testbasicserver.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/basicserver/testbasicserver.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -185,7 +185,7 @@
 {
 	static ConfigurationVerifyKey verifyserverkeys[] = 
 	{
-		SERVERSTREAM_VERIFY_SERVER_KEYS(0)	// no default addresses
+		SERVERSTREAM_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses
 	};
 
 	static ConfigurationVerify verifyserver[] = 
@@ -258,7 +258,7 @@
 {
 	static ConfigurationVerifyKey verifyserverkeys[] = 
 	{
-		SERVERTLS_VERIFY_SERVER_KEYS(0)	// no default listen addresses
+		SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses
 	};
 
 	static ConfigurationVerify verifyserver[] = 

Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -514,7 +514,8 @@
 		{
 			// connect and log in
 			SocketStreamTLS conn;
-			conn.Open(context, Socket::TypeINET, "localhost", BOX_PORT_BBSTORED);
+			conn.Open(context, Socket::TypeINET, "localhost",
+				22011);
 			BackupProtocolClient protocol(conn);
 			protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION);
 			std::auto_ptr<BackupProtocolClientLoginConfirmed> loginConf(protocol.QueryLogin(0x01234567, BackupProtocolClientLogin::Flags_ReadOnly));
@@ -607,7 +608,7 @@
 std::auto_ptr<BackupProtocolClient> Connect(TLSContext& rContext)
 {
 	sSocket.Open(rContext, Socket::TypeINET, 
-		"localhost", BOX_PORT_BBSTORED);
+		"localhost", 22011);
 	std::auto_ptr<BackupProtocolClient> connection;
 	connection.reset(new BackupProtocolClient(sSocket));
 	connection->Handshake();
@@ -2559,13 +2560,6 @@
 				true /* print progress dots */) 
 				== Restore_TargetExists);
 			
-			// Make sure you can't restore to a nonexistant path
-			printf("Try to restore to a path that doesn't exist\n");
-			TEST_THAT(BackupClientRestore(*client, restoredirid, 
-				"testfiles/no-such-path/subdir", 
-				true /* print progress dots */) 
-				== Restore_TargetPathNotFound);
-			
 			// Find ID of the deleted directory
 			deldirid = GetDirID(*client, "x1", restoredirid);
 			TEST_THAT(deldirid != 0);
@@ -2578,6 +2572,15 @@
 				true /* deleted files */) 
 				== Restore_Complete);
 
+			// Make sure you can't restore to a nonexistant path
+			printf("\n\n==== Try to restore to a path "
+				"that doesn't exist\n");
+			fflush(stdout);
+			TEST_THAT(BackupClientRestore(*client, restoredirid, 
+				"testfiles/no-such-path/subdir", 
+				true /* print progress dots */) 
+				== Restore_TargetPathNotFound);
+
 			// Log out
 			client->QueryFinished();
 			sSocket.Close();


Property changes on: box/trunk/test/bbackupd/testfiles
___________________________________________________________________
Name: svn:ignore
   - extcheck1.pl
extcheck2.pl
notifyscript.pl

   + extcheck1.pl
extcheck2.pl
notifyscript.pl
bbackupd.conf
syncallowscript.pl


Modified: box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf
===================================================================
--- box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf	2008-03-28 22:59:28 UTC (rev 2116)
@@ -8,6 +8,7 @@
 DataDirectory = testfiles/bbackupd-data
 
 StoreHostname = localhost
+StorePort = 22011
 AccountNumber = 0x01234567
 
 UpdateStoreInterval = 3

Modified: box/trunk/test/bbackupd/testfiles/bbackupd.conf.in
===================================================================
--- box/trunk/test/bbackupd/testfiles/bbackupd.conf.in	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/bbackupd/testfiles/bbackupd.conf.in	2008-03-28 22:59:28 UTC (rev 2116)
@@ -8,6 +8,7 @@
 DataDirectory = testfiles/bbackupd-data
 
 StoreHostname = localhost
+StorePort = 22011
 AccountNumber = 0x01234567
 
 UpdateStoreInterval = 3

Modified: box/trunk/test/bbackupd/testfiles/bbstored.conf
===================================================================
--- box/trunk/test/bbackupd/testfiles/bbstored.conf	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/bbackupd/testfiles/bbstored.conf	2008-03-28 22:59:28 UTC (rev 2116)
@@ -9,7 +9,7 @@
 Server
 {
 	PidFile = testfiles/bbstored.pid
-	ListenAddresses = inet:localhost
+	ListenAddresses = inet:localhost:22011
 	CertificateFile = testfiles/serverCerts.pem
 	PrivateKeyFile = testfiles/serverPrivKey.pem
 	TrustedCAsFile = testfiles/serverTrustedCAs.pem

Modified: box/trunk/test/common/testcommon.cpp
===================================================================
--- box/trunk/test/common/testcommon.cpp	2008-03-28 22:18:44 UTC (rev 2115)
+++ box/trunk/test/common/testcommon.cpp	2008-03-28 22:59:28 UTC (rev 2116)
@@ -57,15 +57,15 @@
 
 ConfigurationVerifyKey verifykeys1_1_1[] =
 {
-	{"bing", 0, ConfigTest_Exists, 0},
-	{"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"terrible", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("bing", ConfigTest_Exists),
+	ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("terrible", ConfigTest_Exists | ConfigTest_LastEntry)
 };
 
 ConfigurationVerifyKey verifykeys1_1_2[] =
 {
-	{"fish", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("fish", ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry)
 };
 
 
@@ -89,15 +89,15 @@
 
 ConfigurationVerifyKey verifykeys1_1[] =
 {
-	{"value", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"string1", 0, ConfigTest_Exists, 0},
-	{"string2", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("value", ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("string1", ConfigTest_Exists),
+	ConfigurationVerifyKey("string2", ConfigTest_Exists | ConfigTest_LastEntry)
 };
 
 ConfigurationVerifyKey verifykeys1_2[] = 
 {
-	{"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0},
-	{"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0}
+	ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt),
+	ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry)
 };
 
 ConfigurationVerify verifysub1[] = 
@@ -120,14 +120,15 @@
 
 ConfigurationVerifyKey verifykeys1[] =
 {
-		{"notExpected", 0, 0, 0},
-		{"HasDefaultValue", "Lovely default value", 0, 0},
-		{"MultiValue", 0, ConfigTest_MultiValueAllowed, 0},
-		{"BoolTrue1", 0, ConfigTest_IsBool, 0},
-		{"BoolTrue2", 0, ConfigTest_IsBool, 0},
-		{"BoolFalse1", 0, ConfigTest_IsBool, 0},
-		{"BoolFalse2", 0, ConfigTest_IsBool, 0},
-		{"TOPlevel", 0, ConfigTest_LastEntry | ConfigTest_Exists, 0}
+		ConfigurationVerifyKey("notExpected", 0),
+		ConfigurationVerifyKey("HasDefaultValue", 0, "Lovely default value"),
+		ConfigurationVerifyKey("MultiValue", ConfigTest_MultiValueAllowed),
+		ConfigurationVerifyKey("BoolTrue1", ConfigTest_IsBool),
+		ConfigurationVerifyKey("BoolTrue2", ConfigTest_IsBool),
+		ConfigurationVerifyKey("BoolFalse1", ConfigTest_IsBool),
+		ConfigurationVerifyKey("BoolFalse2", ConfigTest_IsBool),
+		ConfigurationVerifyKey("TOPlevel", 
+			ConfigTest_LastEntry | ConfigTest_Exists)
 };
 
 ConfigurationVerify verify =




More information about the Boxbackup-commit mailing list