commit 62c94124d1e7bcf7bfa55465434818b19749c0ad Author: iwakeh iwakeh@torproject.org Date: Wed Jul 20 11:11:37 2016 +0200
Added new properties for scheduled module runs and adapted tests accordingly. Scheduler implementation open. Partially implements task-19018. --- .../java/org/torproject/collector/conf/Key.java | 15 ++++++++++ src/main/resources/collector.properties | 32 +++++++++++++++++++++- .../collector/conf/ConfigurationTest.java | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/collector/conf/Key.java b/src/main/java/org/torproject/collector/conf/Key.java index b4119b6..d8c87ac 100644 --- a/src/main/java/org/torproject/collector/conf/Key.java +++ b/src/main/java/org/torproject/collector/conf/Key.java @@ -17,6 +17,21 @@ public enum Key { RecentPath(Path.class), IndexPath(Path.class), StatsPath(Path.class), + BridgedescsActivated(Boolean.class), + BridgedescsOffsetMinutes(Integer.class), + BridgedescsPeriodMinutes(Integer.class), + ExitlistsActivated(Boolean.class), + ExitlistsOffsetMinutes(Integer.class), + ExitlistsPeriodMinutes(Integer.class), + RelaydescsActivated(Boolean.class), + RelaydescsOffsetMinutes(Integer.class), + RelaydescsPeriodMinutes(Integer.class), + TorperfActivated(Boolean.class), + TorperfOffsetMinutes(Integer.class), + TorperfPeriodMinutes(Integer.class), + UpdateindexActivated(Boolean.class), + UpdateindexOffsetMinutes(Integer.class), + UpdateindexPeriodMinutes(Integer.class), BridgeSnapshotsDirectory(Path.class), CachedRelayDescriptorsDirectories(String[].class), CompressRelayDescriptorDownloads(Boolean.class), diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties index 76ae6bd..8996a1f 100644 --- a/src/main/resources/collector.properties +++ b/src/main/resources/collector.properties @@ -1,5 +1,36 @@ ######## Collector Properties # +######## Run Configuration ######## +## the following defines, if this module is activated +BridgedescsActivated = false +# period in minutes +BridgedescsPeriodMinutes = 60 +# offset in minutes since the epoch and +BridgedescsOffsetMinutes = 9 +## the following defines, if this module is activated +ExitlistsActivated = false +# period in minutes +ExitlistsPeriodMinutes = 60 +# offset in minutes since the epoch and +ExitlistsOffsetMinutes = 2 +## the following defines, if this module is activated +RelaydescsActivated = false +# period in minutes +RelaydescsPeriodMinutes = 30 +# offset in minutes since the epoch and +RelaydescsOffsetMinutes = 5 +## the following defines, if this module is activated +TorperfActivated = false +# period in minutes +TorperfPeriodMinutes = 360 +# offset in minutes since the epoch and +TorperfOffsetMinutes = 1 +# the following defines, if this module is activated +UpdateindexActivated = false +# period in minutes +UpdateindexPeriodMinutes = 2 +# offset in minutes since the epoch and +UpdateindexOffsetMinutes = 0 ######## General Properties ######## InstanceBaseUrl = "https://collector.torproject.org" LockFilePath = lock @@ -7,7 +38,6 @@ IndexPath = out/index ArchivePath = out/archive RecentPath = out/recent StatsPath = out/stats - ######## Relay descriptors ######## # ## Read cached-* files from a local Tor data directory diff --git a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java index ac9fd4f..437939b 100644 --- a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java +++ b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java @@ -22,7 +22,7 @@ public class ConfigurationTest { public void testKeyCount() throws Exception { assertEquals("The number of properties keys in enum Key changed." + "\n This test class should be adapted.", - 33, Key.values().length); + 48, Key.values().length); }
@Test()