~canonical-ci-engineering/charms/precise/uci-engine-key-secret-subordinate/trunk

« back to all changes in this revision

Viewing changes to unit_tests/test_hooks.py

  • Committer: Paul Larson
  • Date: 2014-12-04 19:14:01 UTC
  • mfrom: (2.1.3 key-secret-lpkey)
  • Revision ID: paul.larson@canonical.com-20141204191401-x1e64iclh12exjzw
Add optional launchpad credentials

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
            'ssh-public-key': base64.b64encode('public?'),
102
102
            'gpg-secret-keyring': base64.b64encode('secret!'),
103
103
            'gpg-public-keyring': base64.b64encode('public?'),
 
104
            'launchpad-credentials': base64.b64encode('launchpad!'),
104
105
        }
105
106
        self.config.return_value.update(config)
106
107
 
108
109
        self.assertEqual(['keys'], os.listdir(self.service_dir))
109
110
        keys = sorted(os.listdir(self.keys_dir))
110
111
        self.assertEqual(
111
 
            ['gpg.pub', 'gpg.sec', 'id_rsa', 'id_rsa.pub'], keys)
 
112
            ['gpg.pub', 'gpg.sec', 'id_rsa', 'id_rsa.pub',
 
113
             'launchpad.credentials'], keys)
112
114
 
113
115
    def test_juju_info_joined(self):
114
 
        # Keys are placed immediatelly when the subordinate charm is bound.
 
116
        # Keys are placed immediately when the subordinate charm is bound.
115
117
        os.makedirs(self.service_dir)
116
 
        self.config.return_value['ssh-private-key'] =  base64.b64encode(
 
118
        self.config.return_value['ssh-private-key'] = base64.b64encode(
117
119
            'secret!')
118
120
 
119
121
        hooks.hooks.execute(['hooks/juju-info-relation-joined'])