~axwalk/charms/trusty/postgresql/trunk

« back to all changes in this revision

Viewing changes to test.py

  • Committer: Stuart Bishop
  • Date: 2014-01-22 10:22:42 UTC
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: stuart.bishop@canonical.com-20140122102242-24wml7vmlg3kx730
Multi-version tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
PSQL_CHARM = 'local:postgresql-psql'
30
30
 
31
31
 
32
 
PGDB_APT_CONFIG = {
33
 
    'install_sources': '''\
34
 
            - deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdb main
35
 
            ''',
36
 
    'install_keys': '''\
37
 
            - ACCC4CF8
38
 
            '''}
39
 
 
40
 
 
41
32
class PostgreSQLCharmBaseTestCase(object):
42
33
 
43
34
    VERSION = '9.1'
48
39
        # Generate a basic config for all PostgreSQL charm deploys.
49
40
        # Tests may add or change options.
50
41
        self.pg_config = {'version': self.VERSION}
 
42
        # If we are not using the default version of PostgreSQL for
 
43
        # the Ubuntu release we are testing on, add the PostgreSQL
 
44
        # Global Development Group APT archive to make the official
 
45
        # backports available.
51
46
        if SERIES == 'precise' and self.VERSION == '9.1':
52
 
            pass
 
47
            self.pg_config['pgdg'] = False
53
48
        elif SERIES == 'trusty' and self.VERSION == '9.3':
54
 
            pass
 
49
            self.pg_config['pgdg'] = False
55
50
        else:
56
 
            # If we are not using the default version of PostgreSQL for
57
 
            # the Ubuntu release we are testing on, add the PostgreSQL
58
 
            # Global Development Group APT archive to make the official
59
 
            # backports available.
60
 
            self.pg_config['install_sources'] = yaml.safe_dump([
61
 
                'deb {} {}-pgdg main'.format(
62
 
                    'http://apt.postgresql.org/pub/repos/apt/', SERIES)],
63
 
                default_flow_style=False)
64
 
            self.pg_config['install_keys'] = yaml.safe_dump(
65
 
                ['ACCC4CF8'], default_flow_style=False)
 
51
            self.pg_config['pgdg'] = True
66
52
 
67
53
        self.juju = self.useFixture(JujuFixture(
68
54
            reuse_machines=True,