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

Bug #856635 reported by Paul Larson
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Obsolete LAVA Test
Fix Released
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('', 'console_scripts', 'lava-test')()
  File "/tmp/lava/lava-test/lava_test/", line 43, in main
  File "/usr/lib/pymodules/python2.7/lava_tool/", line 81, in run_with_dispatcher_class
    raise SystemExit(cls().dispatch())
  File "/usr/lib/pymodules/python2.7/lava_tool/", line 74, in dispatch
    return command.invoke()
  File "/tmp/lava/lava-test/lava_test/", line 103, in invoke
    test_list = [provider[test_id] for test_id in provider]
  File "/tmp/lava/lava-test/lava_test/core/", line 159, in __iter__
  File "/tmp/lava/lava-test/lava_test/core/", line 153, in _fill_cache
    test = self._load_remote_test(test_url)
  File "/tmp/lava/lava-test/lava_test/core/", line 142, in _load_remote_test
    with cache.open_cached_url(test_url) as stream:
  File "/usr/lib/python2.7/", line 17, in __enter__
  File "/tmp/lava/lava-test/lava_test/", line 219, in open_cached_url
    stream = urllib2.urlopen(url)
  File "/usr/lib/python2.7/", line 126, in urlopen
    return, data, timeout)
  File "/usr/lib/python2.7/", line 383, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/", line 245, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: examples/stream.json

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.