Exemplo n.º 1
0
 def test_commonName(self):
     """
     C{axiomatic mantissa} generates an SSL certificate with the domain part
     of the admin username as its common name.
     """
     m = Mantissa()
     m.parent = self
     self.dbdir = self.mktemp()
     self.store = Store(filesdir=FilePath(self.dbdir).child("files").path)
     m.parseOptions(['--admin-user', '*****@*****.**', '--admin-password', 'foo'])
     cert = self._getCert()
     self.assertEqual(cert.getSubject().commonName, "example.com")
Exemplo n.º 2
0
    def test_rotate(self):
        """
        The C{keyrotate} subcommand replaces the host key with a new one.
        """
        options = Mantissa()
        options.parent = self
        options.installSite(self.store, u'example.com', u'', False)
        oldKey = self.store.findUnique(SecureShellConfiguration).hostKey

        options.parseOptions(['ssh', 'keyrotate'])
        newKey = self.store.findUnique(SecureShellConfiguration).hostKey

        self.assertNotEqual(oldKey, newKey)
Exemplo n.º 3
0
 def test_commonName(self):
     """
     C{axiomatic mantissa} generates an SSL certificate with the domain part
     of the admin username as its common name.
     """
     m = Mantissa()
     m.parent = self
     self.dbdir = self.mktemp()
     self.store = Store(filesdir=FilePath(self.dbdir).child("files").path)
     m.parseOptions(
         ['--admin-user', '*****@*****.**', '--admin-password', 'foo'])
     cert = self._getCert()
     self.assertEqual(cert.getSubject().commonName, "example.com")
Exemplo n.º 4
0
    def test_rotate(self):
        """
        The C{keyrotate} subcommand replaces the host key with a new one.
        """
        options = Mantissa()
        options.parent = self
        options.installSite(self.store, u'example.com', u'', False)
        oldKey = self.store.findUnique(SecureShellConfiguration).hostKey

        options.parseOptions(['ssh', 'keyrotate'])
        newKey = self.store.findUnique(SecureShellConfiguration).hostKey

        self.assertNotEqual(oldKey, newKey)
Exemplo n.º 5
0
    def test_uniqueSerial(self):
        """
        Test that 'axiomatic mantissa' generates SSL certificates with a
        different unique serial on each invocation.
        """
        m = Mantissa()
        m.parent = self

        self.dbdir = self.mktemp()
        self.store = Store(self.dbdir)
        m.parseOptions(['--admin-password', 'foo'])
        cert1 = self._getCert()

        self.dbdir = self.mktemp()
        self.store = Store(self.dbdir)
        m.parseOptions(['--admin-password', 'foo'])
        cert2 = self._getCert()

        self.assertNotEqual(cert1.serialNumber(), cert2.serialNumber())
Exemplo n.º 6
0
    def test_uniqueSerial(self):
        """
        Test that 'axiomatic mantissa' generates SSL certificates with a
        different unique serial on each invocation.
        """
        m = Mantissa()
        m.parent = self

        self.dbdir = self.mktemp()
        self.store = Store(self.dbdir)
        m.parseOptions(['--admin-password', 'foo'])
        cert1 = self._getCert()

        self.dbdir = self.mktemp()
        self.store = Store(self.dbdir)
        m.parseOptions(['--admin-password', 'foo'])
        cert2 = self._getCert()

        self.assertNotEqual(cert1.serialNumber(), cert2.serialNumber())