Skip to content

Commit 2862941

Browse files
committed
chore: Use uppercase for custom CPU templates
While we use uppercase for static CPU templates (and have to do so to follow the API specification), we used lowercase for custom CPU templates. Using uppercase for both will make integration tests that support both types simpler. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 98aa435 commit 2862941

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

src/vmm/src/cpu_config/aarch64/static_cpu_templates/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mod tests {
3939

4040
#[test]
4141
fn verify_consistency_with_json_templates() {
42-
let static_templates = [(v1n1::v1n1(), "v1n1.json")];
42+
let static_templates = [(v1n1::v1n1(), "V1N1.json")];
4343

4444
for (hardcoded_template, filename) in static_templates {
4545
let json_template = get_json_template(filename);

src/vmm/src/cpu_config/x86_64/static_cpu_templates/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ mod tests {
8484
#[test]
8585
fn verify_consistency_with_json_templates() {
8686
let static_templates = [
87-
(c3::c3(), "c3.json"),
88-
(t2::t2(), "t2.json"),
89-
(t2s::t2s(), "t2s.json"),
90-
(t2cl::t2cl(), "t2cl.json"),
91-
(t2a::t2a(), "t2a.json"),
87+
(c3::c3(), "C3.json"),
88+
(t2::t2(), "T2.json"),
89+
(t2s::t2s(), "T2S.json"),
90+
(t2cl::t2cl(), "T2CL.json"),
91+
(t2a::t2a(), "T2A.json"),
9292
];
9393

9494
for (hardcoded_template, filename) in static_templates {

tests/framework/microvm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ def set_cpu_template(self, cpu_template):
802802
# static CPU template
803803
if isinstance(cpu_template, str):
804804
self.api.machine_config.patch(cpu_template=cpu_template)
805-
self.cpu_template_name = cpu_template.lower()
805+
self.cpu_template_name = cpu_template
806806
# custom CPU template
807807
elif isinstance(cpu_template, dict):
808808
self.api.cpu_config.put(**cpu_template["template"])
809-
self.cpu_template_name = cpu_template["name"].lower()
809+
self.cpu_template_name = cpu_template["name"]
810810

811811
def add_drive(
812812
self,

0 commit comments

Comments
 (0)