@@ -965,26 +965,30 @@ def test_api_vsock(uvm_nano):
965965 """
966966 vm = uvm_nano
967967 # Create a vsock device.
968- vm .api .vsock .put (guest_cid = 15 , uds_path = "vsock.sock" )
968+ vm .api .vsock .put (guest_cid = 15 , uds_path = "vsock.sock" , vsock_type = "stream" )
969969
970970 # Updating an existing vsock is currently fine.
971- vm .api .vsock .put (guest_cid = 166 , uds_path = "vsock.sock" )
971+ vm .api .vsock .put (guest_cid = 166 , uds_path = "vsock.sock" , vsock_type = "stream" )
972972
973973 # Check PUT request. Although vsock_id is deprecated, it must still work.
974- response = vm .api .vsock .put (vsock_id = "vsock1" , guest_cid = 15 , uds_path = "vsock.sock" )
974+ response = vm .api .vsock .put (
975+ vsock_id = "vsock1" , guest_cid = 15 , uds_path = "vsock.sock" , vsock_type = "stream"
976+ )
975977 assert response .headers ["deprecation" ]
976978
977979 # Updating an existing vsock is currently fine even with deprecated
978980 # `vsock_id`.
979- response = vm .api .vsock .put (vsock_id = "vsock1" , guest_cid = 166 , uds_path = "vsock.sock" )
981+ response = vm .api .vsock .put (
982+ vsock_id = "vsock1" , guest_cid = 166 , uds_path = "vsock.sock" , vsock_type = "stream"
983+ )
980984 assert response .headers ["deprecation" ]
981985
982986 # No other vsock action is allowed after booting the VM.
983987 vm .start ()
984988
985989 # Updating an existing vsock should not be fine at this point.
986990 with pytest .raises (RuntimeError ):
987- vm .api .vsock .put (guest_cid = 17 , uds_path = "vsock.sock" )
991+ vm .api .vsock .put (guest_cid = 17 , uds_path = "vsock.sock" , vsock_type = "stream" )
988992
989993
990994def test_api_entropy (uvm_plain ):
@@ -1342,8 +1346,12 @@ def test_get_full_config_after_restoring_snapshot(microvm_factory, uvm_nano):
13421346 }
13431347
13441348 # Add a vsock device.
1345- uvm_nano .api .vsock .put (guest_cid = 15 , uds_path = "vsock.sock" )
1346- setup_cfg ["vsock" ] = {"guest_cid" : 15 , "uds_path" : "vsock.sock" }
1349+ uvm_nano .api .vsock .put (guest_cid = 15 , uds_path = "vsock.sock" , vsock_type = "stream" )
1350+ setup_cfg ["vsock" ] = {
1351+ "guest_cid" : 15 ,
1352+ "uds_path" : "vsock.sock" ,
1353+ "vsock_type" : "stream" ,
1354+ }
13471355
13481356 setup_cfg ["memory-hotplug" ] = {
13491357 "total_size_mib" : 1024 ,
@@ -1478,9 +1486,14 @@ def test_get_full_config(uvm_plain):
14781486 }
14791487
14801488 # Add a vsock device.
1481- response = test_microvm .api .vsock .put (guest_cid = 15 , uds_path = "vsock.sock" )
1482- expected_cfg ["vsock" ] = {"guest_cid" : 15 , "uds_path" : "vsock.sock" }
1483-
1489+ response = test_microvm .api .vsock .put (
1490+ guest_cid = 15 , uds_path = "vsock.sock" , vsock_type = "stream"
1491+ )
1492+ expected_cfg ["vsock" ] = {
1493+ "guest_cid" : 15 ,
1494+ "uds_path" : "vsock.sock" ,
1495+ "vsock_type" : "stream" ,
1496+ }
14841497 # Add hot-pluggable memory.
14851498 expected_cfg ["memory-hotplug" ] = {
14861499 "total_size_mib" : 1024 ,
@@ -1619,7 +1632,7 @@ def test_negative_snapshot_load_api(microvm_factory):
16191632 )
16201633
16211634 # API request without `mem_backend` or `mem_file_path` should fail.
1622- err_msg = "missing field: either `mem_backend` or " " `mem_file_path` is required"
1635+ err_msg = "missing field: either `mem_backend` or `mem_file_path` is required"
16231636 with pytest .raises (RuntimeError , match = err_msg ):
16241637 vm .api .snapshot_load .put (snapshot_path = "foo" )
16251638
0 commit comments