@@ -42,7 +42,7 @@ where PROVIDER_NAME can be one of:
42
42
- cryptoauthlib
43
43
- all
44
44
- coverage
45
- - sqlite -kim
45
+ - on-disk -kim
46
46
"
47
47
}
48
48
@@ -106,6 +106,25 @@ run_key_mappings_tests() {
106
106
RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml key_mappings
107
107
}
108
108
109
+ setup_mappings () {
110
+ # Add the Docker image's mappings in this Parsec service for the key mappings
111
+ # test.
112
+ # The key mappings test in e2e_tests/tests/per_provider/key_mappings.rs will try
113
+ # to use the key generated via the generate-keys.sh script in the test image.
114
+ cp -r /tmp/mappings/ .
115
+ # Add the fake mappings for the key mappings test as well. The test will check that
116
+ # those keys have successfully been deleted.
117
+ # TODO: add fake mappings for the Trusted Service and CryptoAuthLib providers.
118
+ cp -r $( pwd) /e2e_tests/fake_mappings/* mappings
119
+ # As Mbed Crypto saves its keys on the current directory we need to move them
120
+ # as well.
121
+ if [ " $PROVIDER_NAME " = " mbed-crypto" ]; then
122
+ cp /tmp/* .psa_its .
123
+ fi
124
+
125
+ reload_service
126
+ }
127
+
109
128
# Parse arguments
110
129
NO_CARGO_CLEAN=
111
130
NO_STRESS_TEST=
@@ -119,20 +138,21 @@ while [ "$#" -gt 0 ]; do
119
138
--no-stress-test )
120
139
NO_STRESS_TEST=" True"
121
140
;;
122
- mbed-crypto | pkcs11 | tpm | trusted-service | cryptoauthlib | all | cargo-check | sqlite -kim)
141
+ mbed-crypto | pkcs11 | tpm | trusted-service | cryptoauthlib | all | cargo-check | on-disk -kim)
123
142
if [ -n " $PROVIDER_NAME " ]; then
124
143
error_msg " Only one provider name must be given"
125
144
fi
126
145
PROVIDER_NAME=$1
127
146
128
- # Copy provider specific config, unless CI is running `cargo-check` or `sqlite -kim` CI
129
- if [ " $PROVIDER_NAME " != " cargo-check" ] && [ " $PROVIDER_NAME " != " sqlite -kim" ]; then
147
+ # Copy provider specific config, unless CI is running `cargo-check` or `on-disk -kim` CI
148
+ if [ " $PROVIDER_NAME " != " cargo-check" ] && [ " $PROVIDER_NAME " != " on-disk -kim" ]; then
130
149
cp $( pwd) /e2e_tests/provider_cfg/$1 /config.toml $CONFIG_PATH
131
- elif [ " $PROVIDER_NAME " = " sqlite-kim" ]; then
132
- cp $( pwd) /e2e_tests/provider_cfg/all/sqlite-kim-all-providers.toml $CONFIG_PATH
150
+ elif [ " $PROVIDER_NAME " = " on-disk-kim" ]; then
151
+ PROVIDER_NAME=all
152
+ cp $( pwd) /e2e_tests/provider_cfg/all/on-disk-kim-all-providers.toml $CONFIG_PATH
133
153
fi
134
154
135
- if [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " cargo-check" ] || [ " $PROVIDER_NAME " = " sqlite-kim " ] ; then
155
+ if [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " cargo-check" ]; then
136
156
FEATURES=" --features=all-providers,all-authenticators"
137
157
TEST_FEATURES=" --features=all-providers"
138
158
else
157
177
158
178
trap cleanup EXIT
159
179
160
- if [ " $PROVIDER_NAME " = " tpm" ] || [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " coverage" ] || [ " $PROVIDER_NAME " = " sqlite-kim " ] ; then
180
+ if [ " $PROVIDER_NAME " = " tpm" ] || [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " coverage" ]; then
161
181
# Copy the NVChip for previously stored state. This is needed for the key mappings test.
162
182
cp /tmp/NVChip .
163
183
# Start and configure TPM server
@@ -179,7 +199,7 @@ if [ "$PROVIDER_NAME" = "tpm" ] || [ "$PROVIDER_NAME" = "all" ] || [ "$PROVIDER_
179
199
popd
180
200
fi
181
201
182
- if [ " $PROVIDER_NAME " = " pkcs11" ] || [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " coverage" ] || [ " $PROVIDER_NAME " = " sqlite-kim " ] ; then
202
+ if [ " $PROVIDER_NAME " = " pkcs11" ] || [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " coverage" ]; then
183
203
pushd e2e_tests
184
204
# This command suppose that the slot created by the container will be the first one that appears
185
205
# when printing all the available slots.
@@ -237,7 +257,7 @@ if [ "$PROVIDER_NAME" = "coverage" ]; then
237
257
exit 0
238
258
fi
239
259
240
- if [ " $PROVIDER_NAME " = " all" ] || [ " $PROVIDER_NAME " = " sqlite-kim " ] ; then
260
+ if [ " $PROVIDER_NAME " = " all" ]; then
241
261
# Start SPIRE server and agent
242
262
pushd /tmp/spire-0.11.1
243
263
./bin/spire-server run -config conf/server/server.conf &
@@ -255,22 +275,6 @@ if [ "$PROVIDER_NAME" = "all" ] || [ "$PROVIDER_NAME" = "sqlite-kim" ]; then
255
275
popd
256
276
fi
257
277
258
- # Test the SQLite KIM
259
- if [ " $PROVIDER_NAME " = " sqlite-kim" ]; then
260
- echo " Start Parsec for end-to-end tests with sqlite-kim"
261
- RUST_LOG=info RUST_BACKTRACE=1 cargo run --release $FEATURES -- --config $CONFIG_PATH &
262
- # Sleep time needed to make sure Parsec is ready before launching the tests.
263
- wait_for_service
264
-
265
- echo " Execute all-providers sqlite-kim normal tests"
266
- RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml all_providers::normal
267
-
268
- echo " Shutdown Parsec"
269
- stop_service
270
-
271
- exit 0
272
- fi
273
-
274
278
echo " Build test"
275
279
276
280
if [ " $PROVIDER_NAME " = " cargo-check" ]; then
@@ -329,21 +333,6 @@ RUST_BACKTRACE=1 cargo test $FEATURES
329
333
# Removing any mappings left over from integration tests
330
334
rm -rf mappings/
331
335
332
- # Add the Docker image's mappings in this Parsec service for the key mappings
333
- # test.
334
- # The key mappings test in e2e_tests/tests/per_provider/key_mappings.rs will try
335
- # to use the key generated via the generate-keys.sh script in the test image.
336
- cp -r /tmp/mappings/ .
337
- # Add the fake mappings for the key mappings test as well. The test will check that
338
- # those keys have successfully been deleted.
339
- # TODO: add fake mappings for the Trusted Service and CryptoAuthLib providers.
340
- cp -r $( pwd) /e2e_tests/fake_mappings/* mappings
341
- # As Mbed Crypto saves its keys on the current directory we need to move them
342
- # as well.
343
- if [ " $PROVIDER_NAME " = " mbed-crypto" ]; then
344
- cp /tmp/* .psa_its .
345
- fi
346
-
347
336
echo " Start Parsec for end-to-end tests"
348
337
RUST_LOG=info RUST_BACKTRACE=1 cargo run --release $FEATURES -- --config $CONFIG_PATH &
349
338
# Sleep time needed to make sure Parsec is ready before launching the tests.
@@ -353,6 +342,9 @@ if [ "$PROVIDER_NAME" = "all" ]; then
353
342
echo " Execute all-providers normal tests"
354
343
RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml all_providers::normal
355
344
345
+ echo " Execute all-providers cross tests"
346
+ RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml all_providers::cross
347
+
356
348
echo " Execute all-providers multi-tenancy tests"
357
349
# Needed because parsec-client-1 and 2 write to those locations owned by root
358
350
chmod 777 /tmp/parsec/e2e_tests
@@ -363,6 +355,7 @@ if [ "$PROVIDER_NAME" = "all" ]; then
363
355
su -c " PATH=\" /home/parsec-client-1/.cargo/bin:${PATH} \" ;RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml --target-dir /home/parsec-client-1 all_providers::multitenancy::client1_before" parsec-client-1
364
356
su -c " PATH=\" /home/parsec-client-2/.cargo/bin:${PATH} \" ;RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml --target-dir /home/parsec-client-2 all_providers::multitenancy::client2" parsec-client-2
365
357
su -c " PATH=\" /home/parsec-client-1/.cargo/bin:${PATH} \" ;RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml --target-dir /home/parsec-client-1 all_providers::multitenancy::client1_after" parsec-client-1
358
+
366
359
# Change the authentication method
367
360
sed -i ' s/^\(auth_type\s*=\s*\).*$/\1\"UnixPeerCredentials\"/' $CONFIG_PATH
368
361
reload_service
@@ -383,6 +376,8 @@ if [ "$PROVIDER_NAME" = "all" ]; then
383
376
echo " Execute all-providers config tests"
384
377
RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml all_providers::config -- --test-threads=1
385
378
else
379
+ setup_mappings
380
+
386
381
# Per provider tests
387
382
run_normal_tests
388
383
run_old_e2e_tests
0 commit comments