]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: update osdmaptool tests
authorAlex Marangone <amarangone@digitalocean.com>
Wed, 19 Feb 2020 15:51:12 +0000 (07:51 -0800)
committerKefu Chai <kchai@redhat.com>
Mon, 12 Oct 2020 06:17:42 +0000 (14:17 +0800)
Signed-off-by: Alex Marangone <amarangone@digitalocean.com>
src/test/cli/osdmaptool/crush.t
src/test/cli/osdmaptool/help.t
src/test/cli/osdmaptool/upmap.t

index 1d15bf4642aff9e10f20aed7bf38e419af1b12a1..520f11e50d5cf83f381108da7786071c8a185e51 100644 (file)
@@ -8,3 +8,10 @@
   osdmaptool: osdmap file 'myosdmap'
   osdmaptool: imported 497 byte crush map from oc
   osdmaptool: writing epoch 3 to myosdmap
+  $ osdmaptool --adjust-crush-weight 0:5 myosdmap
+  osdmaptool: osdmap file 'myosdmap'
+  Adjusted osd.0 CRUSH weight to 5
+  $ osdmaptool --adjust-crush-weight 0:5 myosdmap --save
+  osdmaptool: osdmap file 'myosdmap'
+  Adjusted osd.0 CRUSH weight to 5
+  osdmaptool: writing epoch 5 to myosdmap
\ No newline at end of file
index 344b7ba62e9e31ad19de29f5233868f415b7d737..7ee3d0aed85b6619e93c5cc57470f26fa4d2fb54 100644 (file)
@@ -14,6 +14,8 @@
      --test-map-pgs-dump-all [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs to osds
      --mark-up-in            mark osds up and in (but do not persist)
      --mark-out <osdid>      mark an osd as out (but do not persist)
+     --mark-up <osdid>       mark an osd as up (but do not persist)
+     --mark-in <osdid>       mark an osd as in (but do not persist)
      --with-default-pool     include default pool when creating map
      --clear-temp            clear pg_temp and primary_temp
      --clean-temps           clean pg_temps
      --upmap-deviation <max-deviation>
                              max deviation from target [default: 5]
      --upmap-pool <poolname> restrict upmap balancing to 1 or more pools
-     --upmap-save            write modified OSDMap with upmap changes
      --upmap-active          Act like an active balancer, keep applying changes until balanced
      --dump <format>         displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported
      --tree                  displays a tree of the map
      --test-crush [--range-first <first> --range-last <last>] map pgs to acting osds
+     --adjust-crush-weight <osdid:weight>[,<osdid:weight>,<...>] change <osdid> CRUSH <weight> (but do not persist)
+     --save                  write modified osdmap with upmap or crush-adjust changes
   [1]
index 23a5d5d32d4bf61cf8e489fe93df0ccfcd0b39b1..b84fea28cb23c86b348ba2868f0ffe88382eabe9 100644 (file)
@@ -1,7 +1,7 @@
   $ osdmaptool --create-from-conf om -c $TESTDIR/ceph.conf.withracks --with-default-pool
   osdmaptool: osdmap file 'om'
   osdmaptool: writing epoch 1 to om
-  $ osdmaptool --osd_calc_pg_upmaps_aggressively=false om --mark-up-in --upmap-max 11 --upmap c
+  $ osdmaptool --osd_calc_pg_upmaps_aggressively=false om --mark-up-in --upmap-max 11 --upmap c --save
   osdmaptool: osdmap file 'om'
   marking all OSDs up and in
   writing upmap command output to: c
@@ -9,6 +9,7 @@
   upmap, max-count 11, max deviation 5
   pools rbd 
   prepared 11/11 changes
+  osdmaptool: writing epoch 3 to om
   $ cat c
   ceph osd pg-upmap-items 1.7 142 147
   ceph osd pg-upmap-items 1.8 219 223
   ceph osd pg-upmap-items 1.51 201 202
   ceph osd pg-upmap-items 1.62 219 223
   ceph osd pg-upmap-items 1.6f 219 223
+  $ osdmaptool --print om | grep pg_upmap_items
+  osdmaptool: osdmap file 'om'
+  pg_upmap_items 1.7 [142,147]
+  pg_upmap_items 1.8 [219,223]
+  pg_upmap_items 1.17 [201,202,171,173]
+  pg_upmap_items 1.1a [201,202]
+  pg_upmap_items 1.1c [201,202]
+  pg_upmap_items 1.20 [201,202]
+  pg_upmap_items 1.24 [232,233]
+  pg_upmap_items 1.51 [201,202]
+  pg_upmap_items 1.62 [219,223]
+  pg_upmap_items 1.6f [219,223]
   $ rm -f om c
+