From 5bc60dca66adf5be70e9721a07472f34953fb54f Mon Sep 17 00:00:00 2001 From: Norbel Ambanumben Date: Mon, 6 Jun 2022 08:55:35 +0100 Subject: [PATCH 1/2] only run torsf and vanilla_tor in unattended/background mode --- ooniprobe/Test/Suite/AbstractSuite.h | 1 + ooniprobe/Test/Suite/ExperimentalSuite.m | 15 +++++++++------ ooniprobe/Utility/BackgroundTask.m | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ooniprobe/Test/Suite/AbstractSuite.h b/ooniprobe/Test/Suite/AbstractSuite.h index 748da021..3981cbf6 100644 --- a/ooniprobe/Test/Suite/AbstractSuite.h +++ b/ooniprobe/Test/Suite/AbstractSuite.h @@ -15,6 +15,7 @@ @property (nonatomic) UIBackgroundTaskIdentifier backgroundTask; @property BOOL interrupted; @property BOOL storeDB; +@property BOOL autoRUn; @property float totalTests; -(id)initSuite:(NSString*)testSuite; diff --git a/ooniprobe/Test/Suite/ExperimentalSuite.m b/ooniprobe/Test/Suite/ExperimentalSuite.m index c52d8be6..d93f9e84 100644 --- a/ooniprobe/Test/Suite/ExperimentalSuite.m +++ b/ooniprobe/Test/Suite/ExperimentalSuite.m @@ -11,12 +11,15 @@ -(id) init { return self; } -- (NSArray*)getTestList { - if ([self.testList count] == 0){ - [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; - [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; - [self.testList addObject:[[Experimental alloc] initWithName:@"torsf"]]; - [self.testList addObject:[[Experimental alloc] initWithName:@"vanilla_tor"]]; +- (NSArray *)getTestList { + if ([self.testList count] == 0) { + if (self.autoRUn) { + [self.testList addObject:[[Experimental alloc] initWithName:@"torsf"]]; + [self.testList addObject:[[Experimental alloc] initWithName:@"vanilla_tor"]]; + } else { + [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; + [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; + } } return super.getTestList; } diff --git a/ooniprobe/Utility/BackgroundTask.m b/ooniprobe/Utility/BackgroundTask.m index 2c47bb91..8d72d259 100644 --- a/ooniprobe/Utility/BackgroundTask.m +++ b/ooniprobe/Utility/BackgroundTask.m @@ -99,6 +99,10 @@ + (void)checkIn { CircumventionSuite *cTest = [[CircumventionSuite alloc] init]; [cTest setStoreDB:NO]; [tests addObject:cTest]; + ExperimentalSuite *eTest = [[ExperimentalSuite alloc] init]; + [eTest setStoreDB:NO]; + [eTest setAutoRUn:YES]; + [tests addObject:eTest]; [[RunningTest currentTest] setAndRun:[NSMutableArray arrayWithArray:tests] inView: nil]; } From 26fcdd8af2cd756c2378955b6549aaf32f228277 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 8 Jun 2022 07:39:55 +0100 Subject: [PATCH 2/2] Update ooniprobe/Test/Suite/ExperimentalSuite.m Co-authored-by: Simone Basso --- ooniprobe/Test/Suite/ExperimentalSuite.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ooniprobe/Test/Suite/ExperimentalSuite.m b/ooniprobe/Test/Suite/ExperimentalSuite.m index d93f9e84..d0bee1c0 100644 --- a/ooniprobe/Test/Suite/ExperimentalSuite.m +++ b/ooniprobe/Test/Suite/ExperimentalSuite.m @@ -16,10 +16,9 @@ - (NSArray *)getTestList { if (self.autoRUn) { [self.testList addObject:[[Experimental alloc] initWithName:@"torsf"]]; [self.testList addObject:[[Experimental alloc] initWithName:@"vanilla_tor"]]; - } else { - [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; - [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; } + [self.testList addObject:[[Experimental alloc] initWithName:@"stunreachability"]]; + [self.testList addObject:[[Experimental alloc] initWithName:@"dnscheck"]]; } return super.getTestList; }