Esempio n. 1
0
    def process_kickstart(self, data):
        """Process the kickstart data."""
        self.set_enabled(data.autopart.autopart)
        request = PartitioningRequest()

        if data.autopart.type is not None:
            request.partitioning_scheme = data.autopart.type

        if data.autopart.fstype:
            request.file_system_type = data.autopart.fstype

        if data.autopart.noboot:
            request.excluded_mount_points.append("/boot")

        if data.autopart.nohome:
            request.excluded_mount_points.append("/home")

        if data.autopart.noswap:
            request.excluded_mount_points.append("swap")

        if data.autopart.encrypted:
            request.encrypted = True
            request.passphrase = data.autopart.passphrase
            request.cipher = data.autopart.cipher
            request.luks_version = data.autopart.luks_version

            request.pbkdf = data.autopart.pbkdf
            request.pbkdf_memory = data.autopart.pbkdf_memory
            request.pbkdf_time = data.autopart.pbkdf_time
            request.pbkdf_iterations = data.autopart.pbkdf_iterations

            request.escrow_certificate = data.autopart.escrowcert
            request.backup_passphrase_enabled = data.autopart.backuppassphrase

        self.set_request(request)
Esempio n. 2
0
    def luks1_format_args_test(self):
        storage = create_storage()
        storage._escrow_certificates["file:///tmp/escrow.crt"] = "CERTIFICATE"

        request = PartitioningRequest()
        request.encrypted = True
        request.passphrase = "passphrase"
        request.luks_version = "luks1"
        request.cipher = "aes-xts-plain64"
        request.escrow_certificate = "file:///tmp/escrow.crt"
        request.backup_passphrase_enabled = True

        args = AutomaticPartitioningTask._get_luks_format_args(storage, request)
        self.assertEqual(args, {
            "passphrase": "passphrase",
            "cipher": "aes-xts-plain64",
            "luks_version": "luks1",
            "pbkdf_args": None,
            "escrow_cert": "CERTIFICATE",
            "add_backup_passphrase": True,
        })