register-test does not deal well with registering a test from file path

Bug #856635 reported by Paul Larson on 2011-09-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Obsolete LAVA Test
Fix Released
Low
Le Chi Thu

Bug Description

It works fine if you use a url (even file://) but if you register a test by giving it the path to a file it let's you do it, then fails badly when you try to list tests.

(s2)plars@plars-t500:/tmp/lava/lava-test$ lava-test register-test examples/stream.json
(s2)plars@plars-t500:/tmp/lava/lava-test$ lava-test list-tests
LAVA: Tests built directly into LAVA Test:
LAVA: - glmemperf
LAVA: - gmpbench
LAVA: - gtkperf
LAVA: - ltp
LAVA: - posixtestsuite
LAVA: - pwrmgmt
LAVA: - stream
LAVA: - tiobench
LAVA: - x11perf
Traceback (most recent call last):
  File "/tmp/lava/s2/bin/lava-test", line 8, in <module>
    load_entry_point('lava-test==0.2.dev', 'console_scripts', 'lava-test')()
  File "/tmp/lava/lava-test/lava_test/main.py", line 43, in main
    run_with_dispatcher_class(LAVATestDispatcher)
  File "/usr/lib/pymodules/python2.7/lava_tool/dispatcher.py", line 81, in run_with_dispatcher_class
    raise SystemExit(cls().dispatch())
  File "/usr/lib/pymodules/python2.7/lava_tool/dispatcher.py", line 74, in dispatch
    return command.invoke()
  File "/tmp/lava/lava-test/lava_test/commands.py", line 103, in invoke
    test_list = [provider[test_id] for test_id in provider]
  File "/tmp/lava/lava-test/lava_test/core/providers.py", line 159, in __iter__
    self._fill_cache()
  File "/tmp/lava/lava-test/lava_test/core/providers.py", line 153, in _fill_cache
    test = self._load_remote_test(test_url)
  File "/tmp/lava/lava-test/lava_test/core/providers.py", line 142, in _load_remote_test
    with cache.open_cached_url(test_url) as stream:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/tmp/lava/lava-test/lava_test/utils.py", line 219, in open_cached_url
    stream = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 383, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 245, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: examples/stream.json

Paul Larson (pwlars) on 2011-09-22
Changed in lava-test:
importance: Undecided → Medium
assignee: nobody → Le Chi Thu (le-chi-thu)
milestone: none → 2011.10
Paul Larson (pwlars) on 2011-09-22
Changed in lava-test:
importance: Medium → Low
Le Chi Thu (le-chi-thu) on 2011-09-27
Changed in lava-test:
status: New → Fix Committed
Le Chi Thu (le-chi-thu) on 2011-10-19
Changed in lava-test:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers