Exemplo n.º 1
0
 def encrypt_lvm_image():
     dmcrypt.create_volume(
         self.path.rpartition("/")[2],
         self.lv_path,
         CONF.ephemeral_storage_encryption.cipher,
         CONF.ephemeral_storage_encryption.key_size,
         key,
     )
Exemplo n.º 2
0
    def test_create_volume(self, mock_execute):
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER,
            self.KEY_SIZE, self.KEY)

        mock_execute.assert_has_calls([
            mock.call(self.TARGET, self.PATH, self.CIPHER, self.KEY_SIZE,
                      self.KEY)
        ])
Exemplo n.º 3
0
    def test_create_volume(self, mock_execute):
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER,
            self.KEY_SIZE, self.KEY)

        mock_execute.assert_has_calls([
            mock.call('cryptsetup', 'create', self.TARGET, self.PATH,
                      '--cipher=' + self.CIPHER,
                      '--key-size=' + str(self.KEY_SIZE),
                      '--key-file=-', process_input=self.KEY_STR,
                      run_as_root=True),
        ])
    def test_create_volume(self, mock_execute):
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER,
            self.KEY_SIZE, self.KEY)

        mock_execute.assert_has_calls([
            mock.call('cryptsetup', 'create', self.TARGET, self.PATH,
                      '--cipher=' + self.CIPHER,
                      '--key-size=' + str(self.KEY_SIZE),
                      '--key-file=-', process_input=self.KEY_STR,
                      run_as_root=True),
        ])
Exemplo n.º 5
0
    def test_create_volume(self):
        expected_commands = [
            ('cryptsetup', 'create', self.TARGET, self.PATH,
             '--cipher=' + self.CIPHER, '--key-size=' + str(self.KEY_SIZE),
             '--key-file=-')
        ]
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER,
                              self.KEY_SIZE, self.KEY)

        self.assertEqual(expected_commands, self.executes)
        self.assertEqual(self.KEY_STR, self.kwargs['process_input'])
Exemplo n.º 6
0
    def test_create_volume(self):
        expected_commands = [('cryptsetup',
               'create',
               self.TARGET,
               self.PATH,
               '--cipher=' + self.CIPHER,
               '--key-size=' + str(self.KEY_SIZE),
               '--key-file=-')]
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER,
            self.KEY_SIZE, self.KEY)

        self.assertEqual(expected_commands, self.executes)
        self.assertEqual(self.KEY_STR, self.kwargs['process_input'])
Exemplo n.º 7
0
    def test_create_volume(self, mock_execute):
        dmcrypt.create_volume(self.TARGET, self.PATH, self.CIPHER, self.KEY_SIZE, self.KEY)

        mock_execute.assert_has_calls(
            [
                mock.call(
                    "cryptsetup",
                    "create",
                    self.TARGET,
                    self.PATH,
                    "--cipher=" + self.CIPHER,
                    "--key-size=" + str(self.KEY_SIZE),
                    "--key-file=-",
                    process_input=self.KEY_STR,
                    run_as_root=True,
                )
            ]
        )
Exemplo n.º 8
0
 def encrypt_lvm_image():
     dmcrypt.create_volume(
         self.path.rpartition('/')[2], self.lv_path,
         CONF.ephemeral_storage_encryption.cipher,
         CONF.ephemeral_storage_encryption.key_size, key)