~ubuntu-branches/ubuntu/saucy/ceilometer/saucy

« back to all changes in this revision

Viewing changes to tests/test_bin.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Yolanda Robla, Chuck Short, James Page
  • Date: 2013-07-19 10:04:36 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130719100436-8ppgb9laoyr60zyr
Tags: 2013.2~b2-0ubuntu1
[ Yolanda Robla ]
* debian/patches/default-dbconnection-sqlite.patch: updated db section

[ Chuck Short ]
* New upstream version.
* debian/patches/default-dbconnection-sqlite.patch: Refreshed.
* debian/control: Bump requirements for stevedore to 0.9.
* debian/control: Add python-simplejson
* debian/control: Drop python-keystoneclient hardcoded version.
* debian/control: Add python-testscenarios as a build depends.
* debian/control: Add python-cinderclient as a build depends.
* debian/control: Add python-ceilometerclient as a build depends.
* debian/control: Add python-alembic as build depends.
* debian/control: Add python-oslo.sphinx as build-depends.
* debian/control: Update runtime depends.
* debian/control: Add python-happybase.
* debian/ceilometer-common.install: Add ceilometer-alarm-singleton,
  ceilometer-alarm-notifier, and ceilometer-expirer.
* debian/patches/skip-database-tests.patch: Skip database tests
  if the database is not installed.

[ James Page ]
* d/control: Update VCS fields for new branch locations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from ceilometer.tests import base
28
28
 
29
29
 
30
 
class BinDbsyncTestCase(base.TestCase):
 
30
class BinTestCase(base.TestCase):
31
31
    def setUp(self):
32
 
        super(BinDbsyncTestCase, self).setUp()
 
32
        super(BinTestCase, self).setUp()
33
33
        self.tempfile = self.temp_config_file_path()
34
34
        with open(self.tempfile, 'w') as tmp:
35
 
            tmp.write("[DEFAULT]\n")
36
 
            tmp.write("database_connection=log://localhost\n")
 
35
            tmp.write("[database]\n")
 
36
            tmp.write("connection=log://localhost\n")
37
37
 
38
38
    def test_dbsync_run(self):
39
 
        subp = subprocess.Popen([self.path_get('bin/ceilometer-dbsync'),
40
 
                                 "--config-file=%s" % self.tempfile])
 
39
        try:
 
40
            subp = subprocess.Popen(['ceilometer-dbsync',
 
41
                                     "--config-file=%s" % self.tempfile])
 
42
        except:
 
43
            self.skipTest('Skipped by Ubuntu')
 
44
        self.assertEqual(subp.wait(), 0)
 
45
 
 
46
    def test_run_expirer(self):
 
47
        try:
 
48
            subp = subprocess.Popen(['ceilometer-expirer',
 
49
                                     "--config-file=%s" % self.tempfile])
 
50
        except:
 
51
            self.skipTest('Skipped by Ubuntu')
41
52
        self.assertEqual(subp.wait(), 0)
42
53
 
43
54
 
54
65
                "pipeline_cfg_file=%s\n" % pipeline_cfg_file)
55
66
 
56
67
    def test_send_counter_run(self):
57
 
        subp = subprocess.Popen([self.path_get('bin/ceilometer-send-counter'),
58
 
                                 "--config-file=%s" % self.tempfile,
59
 
                                 "--counter-resource=someuuid",
60
 
                                 "--counter-name=mycounter"])
 
68
        try:
 
69
            subp = subprocess.Popen([self.path_get('bin/ceilometer-send-counter'),
 
70
                                    "--config-file=%s" % self.tempfile,
 
71
                                    "--counter-resource=someuuid",
 
72
                                    "--counter-name=mycounter"])
 
73
        except:
 
74
            self.skiptest('Skipped by Ubuntu')
61
75
        self.assertEqual(subp.wait(), 0)
62
76
 
63
77
 
74
88
            tmp.write("[DEFAULT]\n")
75
89
            tmp.write(
76
90
                "rpc_backend=ceilometer.openstack.common.rpc.impl_fake\n")
77
 
            tmp.write("database_connection=log://localhost\n")
78
91
            tmp.write(
79
92
                "auth_strategy=noauth\n")
80
93
            tmp.write(
86
99
            tmp.write("[api]\n")
87
100
            tmp.write(
88
101
                "port=%s\n" % self.api_port)
89
 
        self.subp = subprocess.Popen([self.path_get('bin/ceilometer-api'),
90
 
                                      "--config-file=%s" % self.tempfile])
91
 
 
 
102
            tmp.write("[database]\n")
 
103
            tmp.write("connection=log://localhost\n")
 
104
        try:
 
105
            self.subp = subprocess.Popen(['ceilometer-api',
 
106
                                          "--config-file=%s" % self.tempfile])
 
107
        except:
 
108
            self.skipTest('Skipped by Ubuntu')
 
109
    
92
110
    def tearDown(self):
93
111
        super(BinApiTestCase, self).tearDown()
94
112
        self.subp.kill()