feat: implement automated VMID discovery for LXC creation
This commit is contained in:
parent
1536974fcc
commit
b5814e9e61
4 changed files with 35 additions and 4 deletions
|
|
@ -31,3 +31,16 @@ def test_storage_discovery(mock_ssh):
|
|||
storage = mgr.discover_storage()
|
||||
|
||||
assert storage == "local-zfs"
|
||||
|
||||
@patch('infra_cli.proxmox.SSHClient')
|
||||
def test_vmid_discovery(mock_ssh):
|
||||
mock_instance = mock_ssh.return_value
|
||||
mock_instance.run.return_value.returncode = 0
|
||||
mock_instance.run.return_value.stdout = "105"
|
||||
|
||||
mgr = ProxmoxManager(MockConfig())
|
||||
vmid = mgr.get_next_vmid()
|
||||
|
||||
assert vmid == "105"
|
||||
mock_instance.run.assert_called_with("pvesh get /cluster/nextid")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue