xref: /aosp_15_r20/tools/treble/build/sandbox/rbe_test.py (revision 105f628577ac4ba0e277a494fbb614ed8c12a994)
1*105f6285SAndroid Build Coastguard Worker# Copyright 2020 Google LLC
2*105f6285SAndroid Build Coastguard Worker#
3*105f6285SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*105f6285SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*105f6285SAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*105f6285SAndroid Build Coastguard Worker#
7*105f6285SAndroid Build Coastguard Worker#     https://www.apache.org/licenses/LICENSE-2.0
8*105f6285SAndroid Build Coastguard Worker#
9*105f6285SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*105f6285SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*105f6285SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*105f6285SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*105f6285SAndroid Build Coastguard Worker# limitations under the License.
14*105f6285SAndroid Build Coastguard Worker
15*105f6285SAndroid Build Coastguard Worker"""Test rbe."""
16*105f6285SAndroid Build Coastguard Worker
17*105f6285SAndroid Build Coastguard Workerimport unittest
18*105f6285SAndroid Build Coastguard Workerfrom . import rbe
19*105f6285SAndroid Build Coastguard Worker
20*105f6285SAndroid Build Coastguard Workerclass RBETest(unittest.TestCase):
21*105f6285SAndroid Build Coastguard Worker  """unittest for RBE."""
22*105f6285SAndroid Build Coastguard Worker
23*105f6285SAndroid Build Coastguard Worker  def testExtraNsjailArgs(self):
24*105f6285SAndroid Build Coastguard Worker    self.assertEqual(rbe.get_extra_nsjail_args()[0], '--disable_clone_newnet')
25*105f6285SAndroid Build Coastguard Worker
26*105f6285SAndroid Build Coastguard Worker  def testEnv(self):
27*105f6285SAndroid Build Coastguard Worker    env = rbe.prepare_env(env=["RBE_instance=test_instance", "RBE_service=test_service"])
28*105f6285SAndroid Build Coastguard Worker    self.assertIn('USE_RBE=true', env)
29*105f6285SAndroid Build Coastguard Worker    self.assertIn('RBE_instance=test_instance', env)
30*105f6285SAndroid Build Coastguard Worker    self.assertIn('RBE_JAVAC=true', env)
31*105f6285SAndroid Build Coastguard Worker    self.assertIn('RBE_D8=true', env)
32*105f6285SAndroid Build Coastguard Worker    self.assertIn('RBE_R8=true', env)
33*105f6285SAndroid Build Coastguard Worker
34*105f6285SAndroid Build Coastguard Worker
35*105f6285SAndroid Build Coastguard Workerif __name__ == '__main__':
36*105f6285SAndroid Build Coastguard Worker  unittest.main()
37