diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/cli/monmaptool | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/cli/monmaptool')
-rw-r--r-- | src/test/cli/monmaptool/add-exists.t | 29 | ||||
-rw-r--r-- | src/test/cli/monmaptool/add-many.t | 35 | ||||
-rw-r--r-- | src/test/cli/monmaptool/clobber.t | 44 | ||||
-rw-r--r-- | src/test/cli/monmaptool/create-print.t | 23 | ||||
-rw-r--r-- | src/test/cli/monmaptool/create-with-add.t | 15 | ||||
-rw-r--r-- | src/test/cli/monmaptool/feature-set-unset-list.t | 87 | ||||
-rw-r--r-- | src/test/cli/monmaptool/help.t | 11 | ||||
-rw-r--r-- | src/test/cli/monmaptool/print-empty.t | 5 | ||||
-rw-r--r-- | src/test/cli/monmaptool/print-nonexistent.t | 4 | ||||
-rw-r--r-- | src/test/cli/monmaptool/rm-nonexistent.t | 27 | ||||
-rw-r--r-- | src/test/cli/monmaptool/rm.t | 24 | ||||
-rw-r--r-- | src/test/cli/monmaptool/simple.t | 3 |
12 files changed, 307 insertions, 0 deletions
diff --git a/src/test/cli/monmaptool/add-exists.t b/src/test/cli/monmaptool/add-exists.t new file mode 100644 index 000000000..c51d9fb80 --- /dev/null +++ b/src/test/cli/monmaptool/add-exists.t @@ -0,0 +1,29 @@ + $ monmaptool --create mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (0 monitors) + + $ ORIG_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + + $ monmaptool --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: writing epoch 0 to mymonmap (1 monitors) + $ monmaptool --add foo 3.4.5.6:7890 mymonmap + monmaptool: monmap file mymonmap + monmaptool: map already contains mon.foo + monmaptool -h for usage + [1] + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + 0: v1:2.3.4.5:6789/0 mon.foo + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" = "$NEW_FSID" ] diff --git a/src/test/cli/monmaptool/add-many.t b/src/test/cli/monmaptool/add-many.t new file mode 100644 index 000000000..4118d46af --- /dev/null +++ b/src/test/cli/monmaptool/add-many.t @@ -0,0 +1,35 @@ + $ monmaptool --create mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (0 monitors) + + $ ORIG_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + + $ monmaptool --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: writing epoch 0 to mymonmap (1 monitors) + $ monmaptool --add bar 3.4.5.6:7890 mymonmap + monmaptool: monmap file mymonmap + monmaptool: writing epoch 0 to mymonmap (2 monitors) + $ monmaptool --add baz 4.5.6.7:8901 mymonmap + monmaptool: monmap file mymonmap + monmaptool: writing epoch 0 to mymonmap (3 monitors) + $ monmaptool --addv fiz '[v2:172.21.15.68:6791,v1:172.21.15.68:6792]' mymonmap + monmaptool: monmap file mymonmap + monmaptool: writing epoch 0 to mymonmap (4 monitors) + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + 0: v1:2.3.4.5:6789/0 mon.foo + 1: [v2:172.21.15.68:6791/0,v1:172.21.15.68:6792/0] mon.fiz + 2: v2:3.4.5.6:7890/0 mon.bar + 3: v2:4.5.6.7:8901/0 mon.baz + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" = "$NEW_FSID" ] diff --git a/src/test/cli/monmaptool/clobber.t b/src/test/cli/monmaptool/clobber.t new file mode 100644 index 000000000..2fb45ad61 --- /dev/null +++ b/src/test/cli/monmaptool/clobber.t @@ -0,0 +1,44 @@ + $ monmaptool --create --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (1 monitors) + + $ ORIG_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + + $ monmaptool --create mymonmap + monmaptool: monmap file mymonmap + monmaptool: mymonmap exists, --clobber to overwrite + [255] + +# hasn't changed yet + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + 0: v1:2.3.4.5:6789/0 mon.foo + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" = "$NEW_FSID" ] + + $ monmaptool --create --clobber mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (0 monitors) + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" != "$NEW_FSID" ] + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 diff --git a/src/test/cli/monmaptool/create-print.t b/src/test/cli/monmaptool/create-print.t new file mode 100644 index 000000000..31cca0242 --- /dev/null +++ b/src/test/cli/monmaptool/create-print.t @@ -0,0 +1,23 @@ + $ monmaptool --create mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (0 monitors) + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + + $ monmaptool --print -- mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 diff --git a/src/test/cli/monmaptool/create-with-add.t b/src/test/cli/monmaptool/create-with-add.t new file mode 100644 index 000000000..b32a7b35c --- /dev/null +++ b/src/test/cli/monmaptool/create-with-add.t @@ -0,0 +1,15 @@ + $ monmaptool --create --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (1 monitors) + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + 0: v1:2.3.4.5:6789/0 mon.foo diff --git a/src/test/cli/monmaptool/feature-set-unset-list.t b/src/test/cli/monmaptool/feature-set-unset-list.t new file mode 100644 index 000000000..6a0c8a17a --- /dev/null +++ b/src/test/cli/monmaptool/feature-set-unset-list.t @@ -0,0 +1,87 @@ + $ monmaptool --create --add a 10.10.10.10:1234 /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to /tmp/test.monmap.1234 (1 monitors) + + $ monmaptool --feature-list --feature-list plain --feature-list parseable /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + MONMAP FEATURES: + persistent: [none] + optional: [none] + required: [none] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + MONMAP FEATURES: + persistent: [none] + optional: [none] + required: [none] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + monmap:persistent:[none] + monmap:optional:[none] + monmap:required:[none] + available:supported:[kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + available:persistent:[kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + + $ monmaptool --feature-set foo /tmp/test.monmap.1234 + unknown features name 'foo' or unable to parse value: Expected option value to be integer, got 'foo' + monmaptool -h for usage + [1] + + $ monmaptool --feature-set kraken --feature-set 4096 --optional --feature-set 32 --persistent /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + monmaptool: writing epoch 0 to /tmp/test.monmap.1234 (1 monitors) + + $ monmaptool --feature-list /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + MONMAP FEATURES: + persistent: [kraken(1),octopus(32)] + optional: [unknown(4096)] + required: [kraken(1),octopus(32),unknown(4096)] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + + $ monmaptool --feature-unset 32 --optional --feature-list /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + MONMAP FEATURES: + persistent: [kraken(1),octopus(32)] + optional: [unknown(4096)] + required: [kraken(1),octopus(32),unknown(4096)] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + monmaptool: writing epoch 0 to /tmp/test.monmap.1234 (1 monitors) + + $ monmaptool --feature-unset 32 --persistent --feature-unset 4096 --optional --feature-list /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + MONMAP FEATURES: + persistent: [kraken(1)] + optional: [none] + required: [kraken(1)] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + monmaptool: writing epoch 0 to /tmp/test.monmap.1234 (1 monitors) + + $ monmaptool --feature-unset kraken --feature-list /tmp/test.monmap.1234 + monmaptool: monmap file /tmp/test.monmap.1234 + MONMAP FEATURES: + persistent: [none] + optional: [none] + required: [none] + + AVAILABLE FEATURES: + supported: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + persistent: [kraken(1),luminous(2),mimic(4),osdmap-prune(8),nautilus(16),octopus(32),pacific(64),elector-pinging(128),quincy(256),reef(512)] + monmaptool: writing epoch 0 to /tmp/test.monmap.1234 (1 monitors) + + $ rm /tmp/test.monmap.1234 diff --git a/src/test/cli/monmaptool/help.t b/src/test/cli/monmaptool/help.t new file mode 100644 index 000000000..f12c1a07d --- /dev/null +++ b/src/test/cli/monmaptool/help.t @@ -0,0 +1,11 @@ + $ monmaptool --help + usage: monmaptool [--print] [--create [--clobber] [--fsid uuid]] + [--enable-all-features] + [--generate] [--set-initial-members] + [--add name 1.2.3.4:567] [--rm name] + [--addv name [v2:1.2.4.5:567,v1:1.2.3.4:568]] + [--feature-list [plain|parseable]] + [--feature-set <value> [--optional|--persistent]] + [--feature-unset <value> [--optional|--persistent]] + [--set-min-mon-release <release-major-number>] + <mapfilename> diff --git a/src/test/cli/monmaptool/print-empty.t b/src/test/cli/monmaptool/print-empty.t new file mode 100644 index 000000000..cd67db485 --- /dev/null +++ b/src/test/cli/monmaptool/print-empty.t @@ -0,0 +1,5 @@ + $ touch empty + $ monmaptool --print empty + monmaptool: monmap file empty + monmaptool: unable to read monmap file + [255] diff --git a/src/test/cli/monmaptool/print-nonexistent.t b/src/test/cli/monmaptool/print-nonexistent.t new file mode 100644 index 000000000..ae366c1ee --- /dev/null +++ b/src/test/cli/monmaptool/print-nonexistent.t @@ -0,0 +1,4 @@ + $ monmaptool --print nonexistent + monmaptool: monmap file nonexistent + monmaptool: couldn't open nonexistent: (2) No such file or directory + [255] diff --git a/src/test/cli/monmaptool/rm-nonexistent.t b/src/test/cli/monmaptool/rm-nonexistent.t new file mode 100644 index 000000000..165dbb398 --- /dev/null +++ b/src/test/cli/monmaptool/rm-nonexistent.t @@ -0,0 +1,27 @@ + $ monmaptool --create --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (1 monitors) + + $ ORIG_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + + $ monmaptool --rm doesnotexist mymonmap + monmaptool: monmap file mymonmap + monmaptool: removing doesnotexist + monmaptool: map does not contain doesnotexist + monmaptool -h for usage + [1] + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + 0: v1:2.3.4.5:6789/0 mon.foo + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" = "$NEW_FSID" ] diff --git a/src/test/cli/monmaptool/rm.t b/src/test/cli/monmaptool/rm.t new file mode 100644 index 000000000..4a693d59a --- /dev/null +++ b/src/test/cli/monmaptool/rm.t @@ -0,0 +1,24 @@ + $ monmaptool --create --add foo 2.3.4.5:6789 mymonmap + monmaptool: monmap file mymonmap + monmaptool: generated fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + setting min_mon_release = pacific + monmaptool: writing epoch 0 to mymonmap (1 monitors) + + $ ORIG_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + + $ monmaptool --rm foo mymonmap + monmaptool: monmap file mymonmap + monmaptool: removing foo + monmaptool: writing epoch 0 to mymonmap (0 monitors) + + $ monmaptool --print mymonmap + monmaptool: monmap file mymonmap + epoch 0 + fsid [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} (re) + last_changed \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + created \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+.\d\d\d\d (re) + min_mon_release 16 (pacific) + election_strategy: 1 + + $ NEW_FSID="$(monmaptool --print mymonmap|grep ^fsid)" + $ [ "$ORIG_FSID" = "$NEW_FSID" ] diff --git a/src/test/cli/monmaptool/simple.t b/src/test/cli/monmaptool/simple.t new file mode 100644 index 000000000..48c569117 --- /dev/null +++ b/src/test/cli/monmaptool/simple.t @@ -0,0 +1,3 @@ + $ monmaptool + monmaptool: -h or --help for usage + [1] |