Fix config tests for autoUpgradeIntervalH

Conflicts:
	internal/config/config_test.go
This commit is contained in:
Jakob Borg
2014-09-28 21:49:00 +01:00
committed by Audrius Butkevicius
parent ee765990b7
commit 25c080b46f
2 changed files with 33 additions and 30 deletions
+32 -30
View File
@@ -23,21 +23,22 @@ func init() {
func TestDefaultValues(t *testing.T) { func TestDefaultValues(t *testing.T) {
expected := OptionsConfiguration{ expected := OptionsConfiguration{
ListenAddress: []string{"0.0.0.0:22000"}, ListenAddress: []string{"0.0.0.0:22000"},
GlobalAnnServer: "announce.syncthing.net:22026", GlobalAnnServer: "announce.syncthing.net:22026",
GlobalAnnEnabled: true, GlobalAnnEnabled: true,
LocalAnnEnabled: true, LocalAnnEnabled: true,
LocalAnnPort: 21025, LocalAnnPort: 21025,
LocalAnnMCAddr: "[ff32::5222]:21026", LocalAnnMCAddr: "[ff32::5222]:21026",
ParallelRequests: 16, ParallelRequests: 16,
MaxSendKbps: 0, MaxSendKbps: 0,
MaxRecvKbps: 0, MaxRecvKbps: 0,
ReconnectIntervalS: 60, ReconnectIntervalS: 60,
StartBrowser: true, StartBrowser: true,
UPnPEnabled: true, UPnPEnabled: true,
UPnPLease: 0, UPnPLease: 0,
UPnPRenewal: 30, UPnPRenewal: 30,
RestartOnWakeup: true, RestartOnWakeup: true,
AutoUpgradeIntervalH: 12,
} }
cfg := New("test", node1) cfg := New("test", node1)
@@ -115,21 +116,22 @@ func TestNoListenAddress(t *testing.T) {
func TestOverriddenValues(t *testing.T) { func TestOverriddenValues(t *testing.T) {
expected := OptionsConfiguration{ expected := OptionsConfiguration{
ListenAddress: []string{":23000"}, ListenAddress: []string{":23000"},
GlobalAnnServer: "syncthing.nym.se:22026", GlobalAnnServer: "syncthing.nym.se:22026",
GlobalAnnEnabled: false, GlobalAnnEnabled: false,
LocalAnnEnabled: false, LocalAnnEnabled: false,
LocalAnnPort: 42123, LocalAnnPort: 42123,
LocalAnnMCAddr: "quux:3232", LocalAnnMCAddr: "quux:3232",
ParallelRequests: 32, ParallelRequests: 32,
MaxSendKbps: 1234, MaxSendKbps: 1234,
MaxRecvKbps: 2341, MaxRecvKbps: 2341,
ReconnectIntervalS: 6000, ReconnectIntervalS: 6000,
StartBrowser: false, StartBrowser: false,
UPnPEnabled: false, UPnPEnabled: false,
UPnPLease: 60, UPnPLease: 60,
UPnPRenewal: 15, UPnPRenewal: 15,
RestartOnWakeup: false, RestartOnWakeup: false,
AutoUpgradeIntervalH: 24,
} }
cfg, err := Load("testdata/overridenvalues.xml", node1) cfg, err := Load("testdata/overridenvalues.xml", node1)
+1
View File
@@ -16,5 +16,6 @@
<upnpLeaseMinutes>60</upnpLeaseMinutes> <upnpLeaseMinutes>60</upnpLeaseMinutes>
<upnpRenewalMinutes>15</upnpRenewalMinutes> <upnpRenewalMinutes>15</upnpRenewalMinutes>
<restartOnWakeup>false</restartOnWakeup> <restartOnWakeup>false</restartOnWakeup>
<autoUpgradeIntervalH>24</autoUpgradeIntervalH>
</options> </options>
</configuration> </configuration>