@@ -107,6 +107,24 @@ if [ "$PROVIDER_NAME" = "pkcs11" ] || [ "$PROVIDER_NAME" = "all" ]; then
107107 popd
108108fi
109109
110+ if [ " $PROVIDER_NAME " = " all" ]; then
111+ # Start SPIRE server and agent
112+ pushd /tmp/spire-0.11.1
113+ ./bin/spire-server run -config conf/server/server.conf &
114+ sleep 2
115+ TOKEN=` bin/spire-server token generate -spiffeID spiffe://example.org/myagent | cut -d ' ' -f 2`
116+ ./bin/spire-agent run -config conf/agent/agent.conf -joinToken $TOKEN &
117+ sleep 2
118+ # Register parsec-client-1
119+ ./bin/spire-server entry create -parentID spiffe://example.org/myagent \
120+ -spiffeID spiffe://example.org/parsec-client-1 -selector unix:uid:$( id -u parsec-client-1)
121+ # Register parsec-client-2
122+ ./bin/spire-server entry create -parentID spiffe://example.org/myagent \
123+ -spiffeID spiffe://example.org/parsec-client-2 -selector unix:uid:$( id -u parsec-client-2)
124+ sleep 5
125+ popd
126+ fi
127+
110128echo " Build test"
111129RUST_BACKTRACE=1 cargo build $FEATURES
112130
@@ -139,16 +157,31 @@ if [ "$PROVIDER_NAME" = "all" ]; then
139157 RUST_BACKTRACE=1 cargo test $TEST_FEATURES --manifest-path ./e2e_tests/Cargo.toml all_providers::normal
140158
141159 echo " Execute all-providers multi-tenancy tests"
142- su -c " 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
143- su -c " 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
144- su -c " 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
160+ # Needed because parsec-client-1 and 2 write to those locations owned by root
161+ chmod 777 /tmp/parsec/e2e_tests
162+ chmod 777 /tmp/
163+ export SPIFFE_ENDPOINT_SOCKET=" unix:///tmp/agent.sock"
164+
165+ # PATH is defined before each command for user to use their own version of the Rust toolchain
166+ 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
167+ 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
168+ 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
145169 # Change the authentication method
146170 sed -i ' s/^\(auth_type\s*=\s*\).*$/\1\"UnixPeerCredentials\"/' $CONFIG_PATH
147171 pkill -SIGHUP parsec
148172 sleep 5
149- su -c " 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
150- su -c " 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
151- su -c " 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
173+ 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
174+ 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
175+ 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
176+
177+ # Change the authentication method
178+ sed -i ' s/^\(auth_type\s*=\s*\).*$/\1\"JwtSvid\"/' $CONFIG_PATH
179+ sed -i ' s@#workload_endpoint@workload_endpoint@' $CONFIG_PATH
180+ pkill -SIGHUP parsec
181+ sleep 5
182+ 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
183+ 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
184+ 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
152185
153186 # Last test as it changes the service configuration
154187 echo " Execute all-providers config tests"
0 commit comments