]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/cli/crushtool: fix osd tree output
authorSage Weil <sage@redhat.com>
Mon, 17 Jul 2017 13:50:56 +0000 (09:50 -0400)
committerSage Weil <sage@redhat.com>
Fri, 21 Jul 2017 17:50:51 +0000 (13:50 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/cli/crushtool/arg-order-checks.t
src/test/cli/osdmaptool/tree.t

index 9f27dd9432abae2ebdab419e958f800d50f6bc16..540bee1807a5467ab2580fd325ae11ad3d1c4158 100644 (file)
@@ -6,43 +6,43 @@
   $ map="$TESTDIR/foo"
   $ crushtool --outfn "$map" --build --set-chooseleaf-vary-r 0 --set-chooseleaf-stable 0 --num_osds 25 node straw 5 rack straw 1 root straw 0 --reweight-item osd.2 99 -o "$map" --tree
   crushtool reweighting item osd.2 to 99
-  ID\tWEIGHT\tTYPE NAME (esc)
-  -11\t123.00000\troot root (esc)
-  -6\t103.00000\t\track rack0 (esc)
-  -1\t103.00000\t\t\tnode node0 (esc)
-  0\t1.00000\t\t\t\tosd.0 (esc)
-  1\t1.00000\t\t\t\tosd.1 (esc)
-  2\t99.00000\t\t\t\tosd.2 (esc)
-  3\t1.00000\t\t\t\tosd.3 (esc)
-  4\t1.00000\t\t\t\tosd.4 (esc)
-  -7\t5.00000\t\track rack1 (esc)
-  -2\t5.00000\t\t\tnode node1 (esc)
-  5\t1.00000\t\t\t\tosd.5 (esc)
-  6\t1.00000\t\t\t\tosd.6 (esc)
-  7\t1.00000\t\t\t\tosd.7 (esc)
-  8\t1.00000\t\t\t\tosd.8 (esc)
-  9\t1.00000\t\t\t\tosd.9 (esc)
-  -8\t5.00000\t\track rack2 (esc)
-  -3\t5.00000\t\t\tnode node2 (esc)
-  10\t1.00000\t\t\t\tosd.10 (esc)
-  11\t1.00000\t\t\t\tosd.11 (esc)
-  12\t1.00000\t\t\t\tosd.12 (esc)
-  13\t1.00000\t\t\t\tosd.13 (esc)
-  14\t1.00000\t\t\t\tosd.14 (esc)
-  -9\t5.00000\t\track rack3 (esc)
-  -4\t5.00000\t\t\tnode node3 (esc)
-  15\t1.00000\t\t\t\tosd.15 (esc)
-  16\t1.00000\t\t\t\tosd.16 (esc)
-  17\t1.00000\t\t\t\tosd.17 (esc)
-  18\t1.00000\t\t\t\tosd.18 (esc)
-  19\t1.00000\t\t\t\tosd.19 (esc)
-  -10\t5.00000\t\track rack4 (esc)
-  -5\t5.00000\t\t\tnode node4 (esc)
-  20\t1.00000\t\t\t\tosd.20 (esc)
-  21\t1.00000\t\t\t\tosd.21 (esc)
-  22\t1.00000\t\t\t\tosd.22 (esc)
-  23\t1.00000\t\t\t\tosd.23 (esc)
-  24\t1.00000\t\t\t\tosd.24 (esc)
+  ID  WEIGHT    TYPE NAME          
+  -11 123.00000 root root          
+   -6 103.00000     rack rack0     
+   -1 103.00000         node node0 
+    0   1.00000             osd.0  
+    1   1.00000             osd.1  
+    2  99.00000             osd.2  
+    3   1.00000             osd.3  
+    4   1.00000             osd.4  
+   -7   5.00000     rack rack1     
+   -2   5.00000         node node1 
+    5   1.00000             osd.5  
+    6   1.00000             osd.6  
+    7   1.00000             osd.7  
+    8   1.00000             osd.8  
+    9   1.00000             osd.9  
+   -8   5.00000     rack rack2     
+   -3   5.00000         node node2 
+   10   1.00000             osd.10 
+   11   1.00000             osd.11 
+   12   1.00000             osd.12 
+   13   1.00000             osd.13 
+   14   1.00000             osd.14 
+   -9   5.00000     rack rack3     
+   -4   5.00000         node node3 
+   15   1.00000             osd.15 
+   16   1.00000             osd.16 
+   17   1.00000             osd.17 
+   18   1.00000             osd.18 
+   19   1.00000             osd.19 
+  -10   5.00000     rack rack4     
+   -5   5.00000         node node4 
+   20   1.00000             osd.20 
+   21   1.00000             osd.21 
+   22   1.00000             osd.22 
+   23   1.00000             osd.23 
+   24   1.00000             osd.24 
   $ crushtool -d "$map"
   # begin crush map
   tunable choose_local_tries 0
index d2b4009ffd1e8e4656a12ff44a76e73b5dce2258..d2ba473a72e537bf3725be818fb9e8a64a0721aa 100644 (file)
    1       1.00000             osd.1          DNE        0         
    2       1.00000             osd.2          DNE        0         
 
-  $ osdmaptool --tree=json om
+  $ osdmaptool --tree=json-pretty om
   osdmaptool: osdmap file 'om'
-  {"nodes":[{"id":-1,"device_class":"","name":"default","type":"root","type_id":10,"children":[-3]},{"id":-3,"device_class":"","name":"localrack","type":"rack","type_id":3,"children":[-2]},{"id":-2,"device_class":"","name":"localhost","type":"host","type_id":1,"children":[2,1,0]},{"id":0,"device_class":"","name":"osd.0","type":"osd","type_id":0,"crush_weight":1.000000,"depth":3,"exists":0,"status":"down","reweight":0.000000,"primary_affinity":1.000000},{"id":1,"device_class":"","name":"osd.1","type":"osd","type_id":0,"crush_weight":1.000000,"depth":3,"exists":0,"status":"down","reweight":0.000000,"primary_affinity":1.000000},{"id":2,"device_class":"","name":"osd.2","type":"osd","type_id":0,"crush_weight":1.000000,"depth":3,"exists":0,"status":"down","reweight":0.000000,"primary_affinity":1.000000}],"stray":[]}
+  {
+      "nodes": [
+          {
+              "id": -1,
+              "name": "default",
+              "type": "root",
+              "type_id": 10,
+              "children": [
+                  -3
+              ]
+          },
+          {
+              "id": -3,
+              "name": "localrack",
+              "type": "rack",
+              "type_id": 3,
+              "pool_weights": {},
+              "children": [
+                  -2
+              ]
+          },
+          {
+              "id": -2,
+              "name": "localhost",
+              "type": "host",
+              "type_id": 1,
+              "pool_weights": {},
+              "children": [
+                  2,
+                  1,
+                  0
+              ]
+          },
+          {
+              "id": 0,
+              "name": "osd.0",
+              "type": "osd",
+              "type_id": 0,
+              "crush_weight": 1.000000,
+              "depth": 3,
+              "pool_weights": {},
+              "exists": 0,
+              "status": "down",
+              "reweight": 0.000000,
+              "primary_affinity": 1.000000
+          },
+          {
+              "id": 1,
+              "name": "osd.1",
+              "type": "osd",
+              "type_id": 0,
+              "crush_weight": 1.000000,
+              "depth": 3,
+              "pool_weights": {},
+              "exists": 0,
+              "status": "down",
+              "reweight": 0.000000,
+              "primary_affinity": 1.000000
+          },
+          {
+              "id": 2,
+              "name": "osd.2",
+              "type": "osd",
+              "type_id": 0,
+              "crush_weight": 1.000000,
+              "depth": 3,
+              "pool_weights": {},
+              "exists": 0,
+              "status": "down",
+              "reweight": 0.000000,
+              "primary_affinity": 1.000000
+          }
+      ],
+      "stray": []
+  }
+  
+
   $ rm -f om