summaryrefslogtreecommitdiffstats
path: root/src/test/cli/monmaptool/clobber.t
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/cli/monmaptool/clobber.t')
-rw-r--r--src/test/cli/monmaptool/clobber.t40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/cli/monmaptool/clobber.t b/src/test/cli/monmaptool/clobber.t
new file mode 100644
index 00000000..05a55b36
--- /dev/null
+++ b/src/test/cli/monmaptool/clobber.t
@@ -0,0 +1,40 @@
+ $ 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)
+ 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} \d{2}:\d{2}:\d{2}\.\d+ (re)
+ created \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (re)
+ min_mon_release 0 (unknown)
+ 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)
+ 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} \d{2}:\d{2}:\d{2}\.\d+ (re)
+ created \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+ (re)
+ min_mon_release 0 (unknown)