|
@@ -1200,7 +1200,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
export_file = self.output_path + '/exported'
|
|
|
self.cmd('init', self.repository_location, '--encryption', 'keyfile')
|
|
|
repo_id = self._extract_repository_id(self.repository_path)
|
|
|
- self.cmd('key-export', self.repository_location, export_file)
|
|
|
+ self.cmd('key', 'export', self.repository_location, export_file)
|
|
|
|
|
|
with open(export_file, 'r') as fd:
|
|
|
export_contents = fd.read()
|
|
@@ -1216,7 +1216,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
|
|
|
os.unlink(key_file)
|
|
|
|
|
|
- self.cmd('key-import', self.repository_location, export_file)
|
|
|
+ self.cmd('key', 'import', self.repository_location, export_file)
|
|
|
|
|
|
with open(key_file, 'r') as fd:
|
|
|
key_contents2 = fd.read()
|
|
@@ -1227,7 +1227,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
export_file = self.output_path + '/exported'
|
|
|
self.cmd('init', self.repository_location, '--encryption', 'repokey')
|
|
|
repo_id = self._extract_repository_id(self.repository_path)
|
|
|
- self.cmd('key-export', self.repository_location, export_file)
|
|
|
+ self.cmd('key', 'export', self.repository_location, export_file)
|
|
|
|
|
|
with open(export_file, 'r') as fd:
|
|
|
export_contents = fd.read()
|
|
@@ -1246,7 +1246,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
with Repository(self.repository_path) as repository:
|
|
|
repository.save_key(b'')
|
|
|
|
|
|
- self.cmd('key-import', self.repository_location, export_file)
|
|
|
+ self.cmd('key', 'import', self.repository_location, export_file)
|
|
|
|
|
|
with Repository(self.repository_path) as repository:
|
|
|
repo_key2 = RepoKey(repository)
|
|
@@ -1258,17 +1258,17 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
export_file = self.output_path + '/exported'
|
|
|
self.cmd('init', self.repository_location, '--encryption', 'keyfile')
|
|
|
|
|
|
- self.cmd('key-import', self.repository_location, export_file, exit_code=EXIT_ERROR)
|
|
|
+ self.cmd('key', 'import', self.repository_location, export_file, exit_code=EXIT_ERROR)
|
|
|
|
|
|
with open(export_file, 'w') as fd:
|
|
|
fd.write('something not a key\n')
|
|
|
|
|
|
- self.assert_raises(NotABorgKeyFile, lambda: self.cmd('key-import', self.repository_location, export_file))
|
|
|
+ self.assert_raises(NotABorgKeyFile, lambda: self.cmd('key', 'import', self.repository_location, export_file))
|
|
|
|
|
|
with open(export_file, 'w') as fd:
|
|
|
fd.write('BORG_KEY a0a0a0\n')
|
|
|
|
|
|
- self.assert_raises(RepoIdMismatch, lambda: self.cmd('key-import', self.repository_location, export_file))
|
|
|
+ self.assert_raises(RepoIdMismatch, lambda: self.cmd('key', 'import', self.repository_location, export_file))
|
|
|
|
|
|
def test_key_export_paperkey(self):
|
|
|
repo_id = 'e294423506da4e1ea76e8dcdf1a3919624ae3ae496fddf905610c351d3f09239'
|
|
@@ -1283,12 +1283,12 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|
|
fd.write(KeyfileKey.FILE_ID + ' ' + repo_id + '\n')
|
|
|
fd.write(b2a_base64(b'abcdefghijklmnopqrstu').decode())
|
|
|
|
|
|
- self.cmd('key-export', '--paper', self.repository_location, export_file)
|
|
|
+ self.cmd('key', 'export', '--paper', self.repository_location, export_file)
|
|
|
|
|
|
with open(export_file, 'r') as fd:
|
|
|
export_contents = fd.read()
|
|
|
|
|
|
- assert export_contents == """To restore key use borg key-import --paper /path/to/repo
|
|
|
+ assert export_contents == """To restore key use borg key import --paper /path/to/repo
|
|
|
|
|
|
BORG PAPER KEY v1
|
|
|
id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
|