~pwlars/lava-test/bug652946

« back to all changes in this revision

Viewing changes to abrek/testdef.py

  • Committer: Paul Larson
  • Date: 2010-09-28 21:32:44 UTC
  • mfrom: (35.1.5 generate-bundles)
  • Revision ID: paul.larson@canonical.com-20100928213244-7d5fks3yp5c1skza
Add a subcommand to output bundles that can be read by launch-control

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
    def _savetestdata(self):
94
94
        TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
95
 
        testdata = [{}]
 
95
        testdata = {}
 
96
        test_runs = [{}]
96
97
        testdata['format'] = "Dashboard Bundle Format 1.0"
97
98
        filename = os.path.join(self.resultsdir, 'testdata.json')
98
 
        testdata[0]['test_id'] = self.testname
99
 
        testdata[0]['analyzer_assigned_uuid'] = str(uuid1())
100
 
        testdata[0]['time_check_performed'] = False
101
 
        testdata[0]['analyzer_assigned_date'] = datetime.strftime(
 
99
        test_runs[0]['test_id'] = self.testname
 
100
        test_runs[0]['analyzer_assigned_uuid'] = str(uuid1())
 
101
        test_runs[0]['time_check_performed'] = False
 
102
        test_runs[0]['analyzer_assigned_date'] = datetime.strftime(
102
103
                                             self.runner.starttime,TIMEFORMAT)
103
104
        hw = hwprofile.get_hw_context()
104
 
        testdata[0]['hw_context'] = hw
 
105
        test_runs[0]['hw_context'] = hw
105
106
        sw = swprofile.get_sw_context()
106
 
        testdata[0]['sw_context'] = sw
 
107
        test_runs[0]['sw_context'] = sw
 
108
        testdata['test_runs'] = test_runs
107
109
        write_file(json.dumps(testdata), filename)
108
110
 
109
111
    def run(self, quiet=False):