mirror of
git://git.proxmox.com/git/pve-ha-manager.git
synced 2025-01-03 05:17:57 +03:00
tests: add one for service set to be & stay ignored from the start
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
21051707f6
commit
d54c04bdcc
@ -242,13 +242,11 @@ sub active_service_count {
|
||||
my ($self) = @_;
|
||||
|
||||
my $haenv = $self->{haenv};
|
||||
|
||||
my $nodename = $haenv->nodename();
|
||||
|
||||
my $ss = $self->{service_status};
|
||||
|
||||
my $count = 0;
|
||||
|
||||
foreach my $sid (keys %$ss) {
|
||||
my $sd = $ss->{$sid};
|
||||
next if !$sd->{node};
|
||||
@ -256,6 +254,7 @@ sub active_service_count {
|
||||
my $req_state = $sd->{state};
|
||||
next if !defined($req_state);
|
||||
next if $req_state eq 'stopped';
|
||||
# NOTE: 'ignored' ones are already dropped by the manager from service_status
|
||||
next if $req_state eq 'freeze';
|
||||
# erroneous services are not managed by HA, don't count them as active
|
||||
next if $req_state eq 'error';
|
||||
|
2
src/test/test-service-ignore3/README
Normal file
2
src/test/test-service-ignore3/README
Normal file
@ -0,0 +1,2 @@
|
||||
A ignored service should not count towards active node services, so the LRM
|
||||
should stay in the wait_for_agent_lock state.
|
3
src/test/test-service-ignore3/cmdlist
Normal file
3
src/test/test-service-ignore3/cmdlist
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
[ "power node1 on", "power node2 on", "power node3 on"]
|
||||
]
|
5
src/test/test-service-ignore3/hardware_status
Normal file
5
src/test/test-service-ignore3/hardware_status
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"node1": { "power": "off", "network": "off" },
|
||||
"node2": { "power": "off", "network": "off" },
|
||||
"node3": { "power": "off", "network": "off" }
|
||||
}
|
18
src/test/test-service-ignore3/log.expect
Normal file
18
src/test/test-service-ignore3/log.expect
Normal file
@ -0,0 +1,18 @@
|
||||
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 22 node2/crm: status change wait_for_quorum => slave
|
||||
info 24 node3/crm: status change wait_for_quorum => slave
|
||||
info 620 hardware: exit simulation - done
|
1
src/test/test-service-ignore3/manager_status
Normal file
1
src/test/test-service-ignore3/manager_status
Normal file
@ -0,0 +1 @@
|
||||
{}
|
3
src/test/test-service-ignore3/service_config
Normal file
3
src/test/test-service-ignore3/service_config
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"vm:103": { "node": "node3", "state": "ignored" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user