Opened 7 years ago

Closed 19 months ago

#8330 closed defect (wontfix)

ooni: NetTestCase.checkRequiredOptions() does not parse conditionals

Reported by: isis Owned by: hellais
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Normal Keywords: ooni, bugreport, archived-closed-2018-07-04
Cc: hellais, ioerror, aagbsn, isis Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

if i do:

class FooTestCase(nettest.NetTestCase):
    checkRequiredOptions = ['dstip', 'port']

everything works just fine, because checkRequiredOptions() expects a list of things that are expected, and if anything is missing then it doesn't run FooTestCase.

However, what if I wanted to do:

class FooTestCase(nettest.NetTestCase):
    checkRequiredOptions =  ( 'dstip' & 'port' ) || 'file'

Obviously, doesn't work. But it should, because there are now several tests which essentially have their own smarter versions of checkRequiredOptions(), including dnsconsistency and echo.

In the newer (as of right now unmerged) feature/task-manager* branches, either NetTestCase.checkRequiredOptions() or NetTestLoader.checkOptions() should support conditional options (the latter has a call to the former).

Child Tickets

Change History (3)

comment:1 Changed 7 years ago by hellais

To implement this I think we would have to have our own syntax for defining required options and set checkRequiredOptions to be string.

For example:

('dstip' and 'port') or 'file'

can become

class FooTestCase(nettest.NetTestCase):
    checkRequiredOptions =  '( "dstip'" and "port" ) || "file"'

comment:2 Changed 2 years ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:3 Changed 19 months ago by teor

Keywords: archived-closed-2018-07-04 added
Resolution: wontfix
Status: newclosed

Close all tickets in archived components

Note: See TracTickets for help on using tickets.