Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7053 closed defect (fixed)

Ooniprobe doesn't run legacy tests, NameError: name 'inputs' is not defined

Reported by: isis Owned by: isis
Priority: High Milestone:
Component: Archived/Ooni Version:
Severity: Keywords: ooniprobe, ooni, oonitests
Cc: hellais, ioerror Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

After the switch to using twisted.trial as the basis for the API, ooniprobe's class for running legacy tests gives errors:

isis@wintermute:~/code/torproject/ooni-probe/ooni$ ../bin/ooniprobe plugins/captiveportal.py

WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
  File "../bin/ooniprobe", line 23, in <module>
    run()
  File "/home/isis/code/torproject/ooni-probe/ooni/oonicli.py", line 99, in run
    classes = runner.findTestClassesFromConfig(config)
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 110, in findTestClassesFromConfig
    classes.append(adaptLegacyTest(val, config))
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 57, in adaptLegacyTest
    class LegacyOONITest(nettest.TestCase):
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 76, in LegacyOONITest
    inputs = inputs
NameError: name 'inputs' is not defined
isis@wintermute:~/code/torproject/ooni-probe/ooni$ ../bin/ooniprobe plugins/bridget.py -b assets/bridgelist.txt

WARNING: No route found for IPv6 destination :: (no default route?)
Traceback (most recent call last):
  File "../bin/ooniprobe", line 23, in <module>
    run()
  File "/home/isis/code/torproject/ooni-probe/ooni/oonicli.py", line 99, in run
    classes = runner.findTestClassesFromConfig(config)
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 110, in findTestClassesFromConfig
    classes.append(adaptLegacyTest(val, config))
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 57, in adaptLegacyTest
    class LegacyOONITest(nettest.TestCase):
  File "/home/isis/code/torproject/ooni-probe/ooni/runner.py", line 76, in LegacyOONITest
    inputs = inputs
NameError: name 'inputs' is not defined

Child Tickets

Change History (6)

comment:1 Changed 7 years ago by hellais

I think this has to do with the fact that captive portal test does not have any inputs. I am looking into it.

comment:2 Changed 7 years ago by hellais

Actually I think that instead of trying to fix this I will just refactor the Captive Portal test to support the new API. I think that is a more sane approach.

comment:3 Changed 7 years ago by hellais

This is done in commit 5cdc37ff80f1c8343e26f94fd7b7a29b3081ed03.

The report it outputs looks like this:

  • runTime: 7.863668918609619 startTime: 1349516158.063672 tests:

0:

input: null
lastTime: 7.863617897033691
name: captivep
report:

check0x20: !!python/tuple

  • true
  • true
  • [OoNI.nu., OoNI.nu., OoNI.nu., OoNI.nu., OoNI.nu.]
  • [OoNI.nu., OoNI.nu., OoNI.nu., OoNI.nu., OoNI.nu.]
  • ['2012060100', '2012060100', '2012060100', '2012060100', '2012060100'] vendor_dns_tests: google_dns_cp: !!set {} ms_dns_cp: [131.107.255.255] vendor_tests:
  • result: true vt: ['http://www.apple.com/library/test/success.html', Success, '200', 'Mozilla/5.0

(iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko)
Version/3.0 Mobile/1A543a Safari/419.3', Apple HTTP Captive Portal]

Authentication Required, '428', 'Mozilla/5.0 (Windows NT 6.1; rv:5.0)
Gecko/20100101 Firefox/5.0', W3 Captive Portal]

NCSI, MS HTTP Captive Portal]

testStarted: 1349516158.063676

testsRun: 1

I think that we may want to adjust how the information is structured in the check0x20 section and investigate why google_dns_cp is set to an empty set.

comment:4 Changed 7 years ago by hellais

Resolution: fixed
Status: newclosed

comment:5 Changed 7 years ago by isis

Ah, well, that's good to see. :D

I went the other route, and fixed ooni.runner so that all the old tests are actually compatible. So at least we shouldn't have to port any more tests. (Though we might want to anyway just to QA and cleanup.)

comment:6 Changed 7 years ago by isis

I fixed the ooni.runner as at 270db771f360111efd46329796ec4567fedae0f8.

Note: See TracTickets for help on using tickets.