diff options
author | Will Woods <wwoods@redhat.com> | 2009-09-18 14:33:14 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-09-18 14:33:14 -0400 |
commit | 8ed9120f3a0a44704a076605db1b73cf068d65a6 (patch) | |
tree | c2934c32e258487a0c6afba2c4d207e752c32958 | |
parent | 001f8dc0e78e4658d5e82a3c581cbce987b9a0fa (diff) | |
download | israwhidebroken-8ed9120f3a0a44704a076605db1b73cf068d65a6.tar.gz israwhidebroken-8ed9120f3a0a44704a076605db1b73cf068d65a6.tar.xz israwhidebroken-8ed9120f3a0a44704a076605db1b73cf068d65a6.zip |
Add example tree(s) to db
-rw-r--r-- | populate-db.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/populate-db.py b/populate-db.py index 1fbd327..07b23bc 100644 --- a/populate-db.py +++ b/populate-db.py @@ -57,9 +57,20 @@ rats_tests = [ 'http://fedoraproject.org/wiki/QA:Yum_simple_update_test_case'), ] +treedata = [ +# These 3 items correspond to the Fedora 11 trees +{'arch':'i386', + 'compose_id':2009060201, 'tree_time':1243980101, 'repodata_time':1243979414}, +{'arch':'x86_64', + 'compose_id':2009060201, 'tree_time':1243980953, 'repodata_time':1243980178}, +{'arch':'ppc', + 'compose_id':2009060201, 'tree_time':1243981037, 'repodata_time':1243979681}, +] + def setup_database(): # Load the models from israwhidebroken import model + from sqlobject import AND # Add tests to the test table for (n, sd, u) in rats_tests: @@ -69,9 +80,19 @@ def setup_database(): test = model.Test(name=n, short_desc=sd, uri=u) else: print "Test(%s) already exists" % n + # Add example trees + for t in treedata: + exists = model.Tree.select(AND(model.Tree.q.arch == t['arch'], + model.Tree.q.compose_id == t['compose_id'])) + if exists.count() == 0: + print "adding Tree(%u-%s)" % (t['compose_id'], t['arch']) + tree = model.Tree(**t) + else: + print "Tree(%u-%s) already exists" % (t['compose_id'], t['arch']) + model.hub.commit() - # TODO: add a couple of example trees / results + # TODO: add a couple of example results print "Successfully setup" |