Skip to content

Commit 5428c5f

Browse files
tests: add a test for restoring a resource out of drbdsetup show
This demonstrates the effectiveness of the previous commit.
1 parent e9d0212 commit 5428c5f

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

tests/v9/restore_show.res

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
resource "lb-tcp-20251117-171820" {
2+
_this_host {
3+
node-id 0;
4+
volume 0 {
5+
device minor 1;
6+
disk "/dev/scratch/lb-tcp-20251117-171820-disk0";
7+
meta-disk internal;
8+
disk {
9+
disk-flushes no;
10+
md-flushes no;
11+
}
12+
}
13+
}
14+
connection {
15+
_peer_node_id 1;
16+
path {
17+
_this_host ipv4 192.168.122.35:7789;
18+
_remote_host ipv4 192.168.122.36:7789;
19+
}
20+
path {
21+
_this_host ipv4 10.255.0.254:7789;
22+
_remote_host ipv4 10.255.0.162:7789;
23+
}
24+
_cstate Connecting;
25+
net {
26+
load-balance-paths yes;
27+
_name "f43-2";
28+
}
29+
}
30+
}

tests/v9/restore_show.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$ ./drbdadm -c ./restore_show.res -d up all 2>/dev/null
2+
drbdsetup new-resource lb-tcp-20251117-171820 0
3+
drbdsetup new-minor lb-tcp-20251117-171820 1 0
4+
drbdsetup new-peer lb-tcp-20251117-171820 1 --load-balance-paths=yes --_name=f43-2
5+
drbdsetup new-path lb-tcp-20251117-171820 1 ipv4:192.168.122.35:7789 ipv4:192.168.122.36:7789
6+
drbdsetup new-path lb-tcp-20251117-171820 1 ipv4:10.255.0.254:7789 ipv4:10.255.0.162:7789
7+
drbdmeta 1 v09 /dev/scratch/lb-tcp-20251117-171820-disk0 internal repair-md
8+
drbdmeta 1 v09 /dev/scratch/lb-tcp-20251117-171820-disk0 internal apply-al
9+
drbdsetup attach 1 /dev/scratch/lb-tcp-20251117-171820-disk0 /dev/scratch/lb-tcp-20251117-171820-disk0 internal --disk-flushes=no --md-flushes=no
10+
drbdsetup connect lb-tcp-20251117-171820 1

0 commit comments

Comments
 (0)