Skip to content

Commit 45740b8

Browse files
committed
fix: make cargo test pass without gdb feature
In CI we always run unittests with --all-features, but actually without the gdb feature they dont compile. Fix this with some cfgs. Signed-off-by: Patrick Roy <[email protected]>
1 parent aa73f45 commit 45740b8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/firecracker/src/api_server/request/machine_configuration.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ mod tests {
123123
cpu_template: None,
124124
track_dirty_pages: Some(false),
125125
huge_pages: Some(expected),
126+
#[cfg(feature = "gdb")]
127+
gdb_socket_path: None,
126128
};
127129
assert_eq!(
128130
vmm_action_from_request(parse_put_machine_config(&Body::new(body)).unwrap()),
@@ -142,6 +144,8 @@ mod tests {
142144
cpu_template: Some(StaticCpuTemplate::None),
143145
track_dirty_pages: Some(false),
144146
huge_pages: Some(HugePageConfig::None),
147+
#[cfg(feature = "gdb")]
148+
gdb_socket_path: None,
145149
};
146150
assert_eq!(
147151
vmm_action_from_request(parse_put_machine_config(&Body::new(body)).unwrap()),
@@ -161,6 +165,8 @@ mod tests {
161165
cpu_template: None,
162166
track_dirty_pages: Some(true),
163167
huge_pages: Some(HugePageConfig::None),
168+
#[cfg(feature = "gdb")]
169+
gdb_socket_path: None,
164170
};
165171
assert_eq!(
166172
vmm_action_from_request(parse_put_machine_config(&Body::new(body)).unwrap()),
@@ -184,6 +190,8 @@ mod tests {
184190
cpu_template: Some(StaticCpuTemplate::T2),
185191
track_dirty_pages: Some(true),
186192
huge_pages: Some(HugePageConfig::None),
193+
#[cfg(feature = "gdb")]
194+
gdb_socket_path: None,
187195
};
188196
assert_eq!(
189197
vmm_action_from_request(parse_put_machine_config(&Body::new(body)).unwrap()),
@@ -209,6 +217,8 @@ mod tests {
209217
cpu_template: None,
210218
track_dirty_pages: Some(true),
211219
huge_pages: Some(HugePageConfig::None),
220+
#[cfg(feature = "gdb")]
221+
gdb_socket_path: None,
212222
};
213223
assert_eq!(
214224
vmm_action_from_request(parse_put_machine_config(&Body::new(body)).unwrap()),

src/vmm/src/resources.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,8 @@ mod tests {
13281328
cpu_template: Some(StaticCpuTemplate::V1N1),
13291329
track_dirty_pages: Some(false),
13301330
huge_pages: Some(HugePageConfig::None),
1331+
#[cfg(feature = "gdb")]
1332+
gdb_socket_path: None,
13311333
};
13321334

13331335
assert_ne!(

0 commit comments

Comments
 (0)