Skip to content

Commit eb06c5f

Browse files
Make CAS and AC server not to use the same store
When CAS and AC uses the same store, it might produce unexpected side-effects and wrong behaviors. To prevent system from such situation, it currently raises an error when CAS and AC uses the same store. An integration test is added for this.
1 parent f59f8ba commit eb06c5f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
# Copyright 2024 The NativeLink Authors. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# This is a test to check the case when CAS and Ac use the same store.
17+
18+
if [[ $UNDER_TEST_RUNNER -ne 1 ]]; then
19+
echo "This script should be run under run_integration_tests.sh"
20+
exit 1
21+
fi
22+
23+
set -x
24+
25+
EXIT_CODE=0
26+
sudo docker compose --file docker-compose.test.yml up -d
27+
if perl -e 'alarm shift; exec @ARGV' 30 bash -c 'until sudo docker compose --file docker-compose.test.yml logs | grep -q "CAS and AC use the same store"; do sleep 1; done'
28+
then
29+
echo "String 'CAS and AC use the same store' found in the logs."
30+
else
31+
echo "String 'CAS and AC use the same store' not found in the logs within the given time."
32+
$EXIT_CODE=1
33+
fi
34+
sudo docker compose --file docker-compose.test.yml rm --stop -f
35+
echo "" # New line.
36+
37+
exit $EXIT_CODE

0 commit comments

Comments
 (0)