5
0
mirror of git://git.proxmox.com/git/pve-ha-manager.git synced 2025-01-03 05:17:57 +03:00

tests: add scenario for CRM going idle

To better show what changes in he future implementation of this
feature in a next commit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-10-25 13:44:03 +02:00
parent e5f9b5f6e3
commit e857e63846
6 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,7 @@
Test an user triggered service removal from a previously active HA stack, which
should make the LRM and the CRM go idle and dropping the lock once enough
cycles passed without any new service.
We use some delays to stall execution, as else we'd exit the test-simulation
earlier than the 90 rounds idle time required before the CRM gives up their
lock and watchdog.

View File

@ -0,0 +1,17 @@
[
[ "power node1 on", "power node2 on", "power node3 on"],
[ "service vm:103 delete" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ],
[ "delay 0" ]
]

View File

@ -0,0 +1,5 @@
{
"node1": { "power": "off", "network": "off" },
"node2": { "power": "off", "network": "off" },
"node3": { "power": "off", "network": "off" }
}

View File

@ -0,0 +1,43 @@
info 0 hardware: starting simulation
info 20 cmdlist: execute power node1 on
info 20 node1/crm: status change startup => wait_for_quorum
info 20 node1/lrm: status change startup => wait_for_agent_lock
info 20 cmdlist: execute power node2 on
info 20 node2/crm: status change startup => wait_for_quorum
info 20 node2/lrm: status change startup => wait_for_agent_lock
info 20 cmdlist: execute power node3 on
info 20 node3/crm: status change startup => wait_for_quorum
info 20 node3/lrm: status change startup => wait_for_agent_lock
info 20 node1/crm: got lock 'ha_manager_lock'
info 20 node1/crm: status change wait_for_quorum => master
info 20 node1/crm: node 'node1': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'vm:103' on node 'node3'
info 20 node1/crm: service 'vm:103': state changed from 'request_start' to 'started' (node = node3)
info 22 node2/crm: status change wait_for_quorum => slave
info 24 node3/crm: status change wait_for_quorum => slave
info 25 node3/lrm: got lock 'ha_agent_node3_lock'
info 25 node3/lrm: status change wait_for_agent_lock => active
info 25 node3/lrm: starting service vm:103
info 25 node3/lrm: service status vm:103 started
info 120 cmdlist: execute service vm:103 delete
info 120 node1/crm: removing stale service 'vm:103' (no config)
info 122 node2/crm: status change slave => wait_for_quorum
info 124 node3/crm: status change slave => wait_for_quorum
info 220 cmdlist: execute delay 0
info 320 cmdlist: execute delay 0
info 420 cmdlist: execute delay 0
info 520 cmdlist: execute delay 0
info 620 cmdlist: execute delay 0
info 720 cmdlist: execute delay 0
info 820 cmdlist: execute delay 0
info 920 cmdlist: execute delay 0
info 1020 cmdlist: execute delay 0
info 1120 cmdlist: execute delay 0
info 1220 cmdlist: execute delay 0
info 1320 cmdlist: execute delay 0
info 1325 node3/lrm: node had no service configured for 60 rounds, going idle.
info 1325 node3/lrm: status change active => wait_for_agent_lock
info 1420 cmdlist: execute delay 0
info 2020 hardware: exit simulation - done

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,3 @@
{
"vm:103": { "node": "node3", "state": "enabled" }
}