Exemplo n.º 1
0
    def _store_certs(self):
        # pylint: disable=protected-access
        from letsencrypt.revoker import Revoker
        Revoker.store_cert_key(self.paths[0], self.key_path, self.mock_config)
        Revoker.store_cert_key(self.paths[1], self.key_path, self.mock_config)

        # Set metadata
        for i in xrange(2):
            self.certs[i].add_meta(
                i, self.paths[i], self.key_path,
                Revoker._get_backup(self.backup_dir, i, self.paths[i]),
                Revoker._get_backup(self.backup_dir, i, self.key_path))
Exemplo n.º 2
0
    def _store_certs(self):
        # pylint: disable=protected-access
        from letsencrypt.revoker import Revoker
        Revoker.store_cert_key(self.paths[0], self.key_path, self.mock_config)
        Revoker.store_cert_key(self.paths[1], self.key_path, self.mock_config)

        # Set metadata
        for i in xrange(2):
            self.certs[i].add_meta(
                i, self.paths[i], self.key_path,
                Revoker._get_backup(self.backup_dir, i, self.paths[i]),
                Revoker._get_backup(self.backup_dir, i, self.key_path))
Exemplo n.º 3
0
    def test_store_one_mixed(self):
        from letsencrypt.revoker import Revoker
        self._write_rows(
            [["5", "blank", "blank"], ["18", "dc", "dc"], ["21", "b", "b"]])
        self._call(self.paths[0], self.key_path)

        self.assertEqual(
            self._get_rows()[3], ["22", self.paths[0], self.key_path])

        # pylint: disable=protected-access
        self.assertTrue(os.path.isfile(
            Revoker._get_backup(self.backup_dir, 22, self.paths[0])))
        self.assertTrue(os.path.isfile(
            Revoker._get_backup(self.backup_dir, 22, self.key_path)))
Exemplo n.º 4
0
    def test_store_one_mixed(self):
        from letsencrypt.revoker import Revoker
        self._write_rows(
            [["5", "blank", "blank"], ["18", "dc", "dc"], ["21", "b", "b"]])
        self._call(self.paths[0], self.key_path)

        self.assertEqual(
            self._get_rows()[3], ["22", self.paths[0], self.key_path])

        # pylint: disable=protected-access
        self.assertTrue(os.path.isfile(
            Revoker._get_backup(self.backup_dir, 22, self.paths[0])))
        self.assertTrue(os.path.isfile(
            Revoker._get_backup(self.backup_dir, 22, self.key_path)))
Exemplo n.º 5
0
    def test_store_two(self):
        from letsencrypt.revoker import Revoker
        self._call(self.paths[0], self.key_path)
        self._call(self.paths[1], self.key_path)

        self.assertTrue(os.path.isfile(self.list_path))
        rows = self._get_rows()

        for i, row in enumerate(rows):
            # pylint: disable=protected-access
            self.assertTrue(os.path.isfile(
                Revoker._get_backup(self.backup_dir, i, self.paths[i])))
            self.assertTrue(os.path.isfile(
                Revoker._get_backup(self.backup_dir, i, self.key_path)))
            self.assertEqual([str(i), self.paths[i], self.key_path], row)

        self.assertEqual(len(rows), 2)
Exemplo n.º 6
0
    def test_store_two(self):
        from letsencrypt.revoker import Revoker
        self._call(self.paths[0], self.key_path)
        self._call(self.paths[1], self.key_path)

        self.assertTrue(os.path.isfile(self.list_path))
        rows = self._get_rows()

        for i, row in enumerate(rows):
            # pylint: disable=protected-access
            self.assertTrue(os.path.isfile(
                Revoker._get_backup(self.backup_dir, i, self.paths[i])))
            self.assertTrue(os.path.isfile(
                Revoker._get_backup(self.backup_dir, i, self.key_path)))
            self.assertEqual([str(i), self.paths[i], self.key_path], row)

        self.assertEqual(len(rows), 2)