@@ -98,71 +98,11 @@ To learn more about Rustacean integration test, see
98
98
Tests can be added in any (existing or new) sub-directory of ` tests/ ` , in files
99
99
named ` test_*.py ` .
100
100
101
- Fixtures can be used to quickly build Firecracker microvm integration tests
102
- that run on all microvm images in ` s3://spec.ccfc.min/img/ ` .
103
-
104
- For example, the test below makes use of the ` test_microvm_any ` fixture and will
105
- be run on every microvm image in the bucket, each as a separate test case.
106
-
107
- ``` python
108
- def test_with_any_microvm (test_microvm_any ):
109
- response = test_microvm_any.machine_cfg.put(
110
- vcpu_count = 2
111
- )
112
- assert (test_microvm_any.api_session.is_good_response(response.status_code))
113
-
114
- # [...]
115
-
116
- response = test_microvm_any.actions.put(action_type = ' InstanceStart' )
117
- assert (test_microvm_any.api_session.is_good_response(response.status_code))
118
- ```
119
-
120
- If instead of ` test_microvm_any ` , a capability-based fixture would be used,
121
- e.g., ` test_microvm_with_net ` , then the test would instead run on all microvm
122
- images with the ` capability:net ` tag.
123
-
124
- To see what fixtures are available, inspect ` conftest.py ` .
125
-
126
101
## Adding Rust Tests
127
102
128
103
Add a new function annotated with ` #[test] ` in
129
104
[ ` integration_tests.rs ` ] ( ../src/vmm/tests/integration_tests.rs ) .
130
105
131
- ## Adding Microvm Images
132
-
133
- Simply place the microvm image under ` s3://spec.ccfc.min/img/ ` .
134
- The layout is:
135
-
136
- ``` tree
137
- s3://<bucket-url>/img/
138
- <microvm_test_image_folder_n>/
139
- kernel/
140
- <optional_kernel_name.>vmlinux.bin
141
- fsfiles/
142
- <rootfs_name>rootfs.ext4
143
- <optional_initrd_name.>initrd.img
144
- <other_fsfile_n>
145
- ...
146
- <other_resource_n>
147
- ...
148
- ...
149
- ```
150
-
151
- Then, tag ` <microvm_test_image_folder_n> ` with:
152
-
153
- ``` json
154
- TagSet = [{"key": "capability:<cap_name>", "value": ""}, ...]
155
- ```
156
-
157
- For example, this can be done from the AWS CLI with:
158
-
159
- ``` sh
160
- aws s3api put-object-tagging \
161
- --bucket ${bucket_name} \
162
- --key img/${microvm_test_image_folder_n} \
163
- --tagging " TagSet=[{Key=capability:${cap_name} ,Value=''}]"
164
- ```
165
-
166
106
## Adding Fixtures
167
107
168
108
By default, ` pytest ` makes all fixtures in ` conftest.py ` available to all test
@@ -300,17 +240,11 @@ Pytest was chosen because:
300
240
301
241
### Features
302
242
303
- - Modify ` MicrovmImageS3Fetcher ` to make the above FAQ possible (the borg
304
- pattern is wrong for this).
305
243
- A fixture for interacting with microvms via SSH.
306
- - Support generating fixtures with more than one capability. This is supported
307
- by the MicrovmImageS3Fetcher, but not plumbed through.
308
244
- Use the Firecracker Open API spec to populate Microvm API resource URLs.
309
- - Manage output better: handle quietness levels, and use pytest reports.
310
245
- Do the testrun in a container for better insulation.
311
- - Add support for non-Rust style checks.
312
246
- Event-based monitoring of microvm socket file creation to avoid while spins.
313
- - Self-tests (e.g., Tests that test the testing system, python3 style tests ).
247
+ - Self-tests (e.g., Tests that test the testing system).
314
248
315
249
### Implementation
316
250
@@ -323,8 +257,6 @@ Pytest was chosen because:
323
257
324
258
### Bug fixes
325
259
326
- - Fix the /install-kcov.sh bug.
327
-
328
260
## Further Reading
329
261
330
262
Contributing to this testing system requires a dive deep on ` pytest ` .
0 commit comments