diff --git a/doc/test_with_td_payload.md b/doc/test_with_td_payload.md index fe80eac8..ceebe43c 100644 --- a/doc/test_with_td_payload.md +++ b/doc/test_with_td_payload.md @@ -54,7 +54,8 @@ The output file **final.test.bin** with [test.json](../tests/test-td-payload/src "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true diff --git a/tests/test-td-payload/config/test_config_1.json b/tests/test-td-payload/config/test_config_1.json index 8ba56e8c..bde5e1a0 100644 --- a/tests/test-td-payload/config/test_config_1.json +++ b/tests/test-td-payload/config/test_config_1.json @@ -5,7 +5,8 @@ "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true @@ -16,7 +17,8 @@ "attributes": 0, "max_vcpus": 2, "num_vcpus": 2, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -27,7 +29,8 @@ "attributes": 0, "max_vcpus": 4, "num_vcpus": 4, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -38,7 +41,8 @@ "attributes": 0, "max_vcpus": 8, "num_vcpus": 8, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false diff --git a/tests/test-td-payload/config/test_config_2.json b/tests/test-td-payload/config/test_config_2.json index c7c9f3da..7ffb65f4 100644 --- a/tests/test-td-payload/config/test_config_2.json +++ b/tests/test-td-payload/config/test_config_2.json @@ -5,7 +5,8 @@ "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true @@ -16,7 +17,8 @@ "attributes": 0, "max_vcpus": 2, "num_vcpus": 2, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -27,7 +29,8 @@ "attributes": 0, "max_vcpus": 4, "num_vcpus": 4, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -38,7 +41,8 @@ "attributes": 0, "max_vcpus": 8, "num_vcpus": 8, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false diff --git a/tests/test-td-payload/config/test_config_3.json b/tests/test-td-payload/config/test_config_3.json index 25ae2d48..ee423d56 100644 --- a/tests/test-td-payload/config/test_config_3.json +++ b/tests/test-td-payload/config/test_config_3.json @@ -5,7 +5,8 @@ "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -16,7 +17,8 @@ "attributes": 0, "max_vcpus": 2, "num_vcpus": 2, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true @@ -27,7 +29,8 @@ "attributes": 0, "max_vcpus": 4, "num_vcpus": 4, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -38,7 +41,8 @@ "attributes": 0, "max_vcpus": 8, "num_vcpus": 8, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false diff --git a/tests/test-td-payload/config/test_config_4.json b/tests/test-td-payload/config/test_config_4.json index 959814b7..ee11bb71 100644 --- a/tests/test-td-payload/config/test_config_4.json +++ b/tests/test-td-payload/config/test_config_4.json @@ -5,7 +5,8 @@ "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -16,7 +17,8 @@ "attributes": 0, "max_vcpus": 2, "num_vcpus": 2, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -27,7 +29,8 @@ "attributes": 0, "max_vcpus": 4, "num_vcpus": 4, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true @@ -38,7 +41,8 @@ "attributes": 0, "max_vcpus": 8, "num_vcpus": 8, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false diff --git a/tests/test-td-payload/config/test_config_5.json b/tests/test-td-payload/config/test_config_5.json index c3d375c5..b45882d3 100644 --- a/tests/test-td-payload/config/test_config_5.json +++ b/tests/test-td-payload/config/test_config_5.json @@ -5,7 +5,8 @@ "attributes": 0, "max_vcpus": 1, "num_vcpus": 1, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -16,7 +17,8 @@ "attributes": 0, "max_vcpus": 2, "num_vcpus": 2, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -27,7 +29,8 @@ "attributes": 0, "max_vcpus": 4, "num_vcpus": 4, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": false @@ -38,7 +41,8 @@ "attributes": 0, "max_vcpus": 8, "num_vcpus": 8, - "rsvd": [0,0,0] + "vcpu_index":0, + "rsvd": [0,0,0,0,0] }, "result": "None", "run": true diff --git a/tests/test-td-payload/src/testtdinfo.rs b/tests/test-td-payload/src/testtdinfo.rs index cba1d0cf..0d238e93 100644 --- a/tests/test-td-payload/src/testtdinfo.rs +++ b/tests/test-td-payload/src/testtdinfo.rs @@ -18,7 +18,8 @@ pub struct TdInfoRetData { pub attributes: u64, pub max_vcpus: u32, pub num_vcpus: u32, - pub rsvd: [u64; 3], + pub vcpu_index: u32, + pub rsvd: [u32; 5], } #[derive(Debug, Serialize, Deserialize)] @@ -26,7 +27,8 @@ pub struct TdInfoExpectedData { pub attributes: u64, pub max_vcpus: u32, pub num_vcpus: u32, - pub rsvd: [u64; 3], + pub vcpu_index: u32, + pub rsvd: [u32; 5], } /** @@ -98,6 +100,17 @@ impl TestCase for Tdinfo { return; } + if (self.expected.vcpu_index != td_info.vcpu_index) { + log::info!( + "Check vcpu_index fail - Expected {:?}: Actual {:?}\n", + self.expected.vcpu_index, + td_info.vcpu_index + ); + return; + } else { + log::info!("vcpu_index - {:?}\n", td_info.vcpu_index); + } + if (self.expected.rsvd != td_info.rsvd) { log::info!( "Check rsvd fail - Expected {:?}: Actual {:?}\n",