qemu-iotests: Check common namespace for id and node-name
A name that is taken by an ID can't be taken by a node-name at the same time. Check that conflicts are correctly detected. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
		
							parent
							
								
									f2d953ec31
								
							
						
					
					
						commit
						90d9d30152
					
				| 
						 | 
					@ -83,6 +83,7 @@ run_qemu <<EOF
 | 
				
			||||||
      "options": {
 | 
					      "options": {
 | 
				
			||||||
        "driver": "$IMGFMT",
 | 
					        "driver": "$IMGFMT",
 | 
				
			||||||
        "id": "disk",
 | 
					        "id": "disk",
 | 
				
			||||||
 | 
					        "node-name": "test-node",
 | 
				
			||||||
        "file": {
 | 
					        "file": {
 | 
				
			||||||
            "driver": "file",
 | 
					            "driver": "file",
 | 
				
			||||||
            "filename": "$TEST_IMG"
 | 
					            "filename": "$TEST_IMG"
 | 
				
			||||||
| 
						 | 
					@ -102,6 +103,57 @@ run_qemu <<EOF
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					{ "execute": "blockdev-add",
 | 
				
			||||||
 | 
					  "arguments": {
 | 
				
			||||||
 | 
					      "options": {
 | 
				
			||||||
 | 
					        "driver": "$IMGFMT",
 | 
				
			||||||
 | 
					        "id": "test-node",
 | 
				
			||||||
 | 
					        "file": {
 | 
				
			||||||
 | 
					            "driver": "file",
 | 
				
			||||||
 | 
					            "filename": "$TEST_IMG"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					{ "execute": "blockdev-add",
 | 
				
			||||||
 | 
					  "arguments": {
 | 
				
			||||||
 | 
					      "options": {
 | 
				
			||||||
 | 
					        "driver": "$IMGFMT",
 | 
				
			||||||
 | 
					        "id": "disk2",
 | 
				
			||||||
 | 
					        "node-name": "disk",
 | 
				
			||||||
 | 
					        "file": {
 | 
				
			||||||
 | 
					            "driver": "file",
 | 
				
			||||||
 | 
					            "filename": "$TEST_IMG"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					{ "execute": "blockdev-add",
 | 
				
			||||||
 | 
					  "arguments": {
 | 
				
			||||||
 | 
					      "options": {
 | 
				
			||||||
 | 
					        "driver": "$IMGFMT",
 | 
				
			||||||
 | 
					        "id": "disk2",
 | 
				
			||||||
 | 
					        "node-name": "test-node",
 | 
				
			||||||
 | 
					        "file": {
 | 
				
			||||||
 | 
					            "driver": "file",
 | 
				
			||||||
 | 
					            "filename": "$TEST_IMG"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					{ "execute": "blockdev-add",
 | 
				
			||||||
 | 
					  "arguments": {
 | 
				
			||||||
 | 
					      "options": {
 | 
				
			||||||
 | 
					        "driver": "$IMGFMT",
 | 
				
			||||||
 | 
					        "id": "disk3",
 | 
				
			||||||
 | 
					        "node-name": "disk3",
 | 
				
			||||||
 | 
					        "file": {
 | 
				
			||||||
 | 
					            "driver": "file",
 | 
				
			||||||
 | 
					            "filename": "$TEST_IMG"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
{ "execute": "quit" }
 | 
					{ "execute": "quit" }
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,11 @@ QMP_VERSION
 | 
				
			||||||
{"return": {}}
 | 
					{"return": {}}
 | 
				
			||||||
{"return": {}}
 | 
					{"return": {}}
 | 
				
			||||||
{"error": {"class": "GenericError", "desc": "Device with id 'disk' already exists"}}
 | 
					{"error": {"class": "GenericError", "desc": "Device with id 'disk' already exists"}}
 | 
				
			||||||
 | 
					{"error": {"class": "GenericError", "desc": "Device with node-name 'test-node' already exists"}}
 | 
				
			||||||
 | 
					main-loop: WARNING: I/O thread spun for 1000 iterations
 | 
				
			||||||
 | 
					{"error": {"class": "GenericError", "desc": "could not open disk image disk2: node-name=disk is conflicting with a device id"}}
 | 
				
			||||||
 | 
					{"error": {"class": "GenericError", "desc": "could not open disk image disk2: Duplicate node name"}}
 | 
				
			||||||
 | 
					{"error": {"class": "GenericError", "desc": "could not open disk image disk3: node-name=disk3 is conflicting with a device id"}}
 | 
				
			||||||
{"return": {}}
 | 
					{"return": {}}
 | 
				
			||||||
{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
 | 
					{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
 | 
				
			||||||
{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
 | 
					{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue