1 /* 2 * Copyright (C) 2024 The Android Open Source Project 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 package com.android.sdksandbox.next; 17 18 import static com.google.common.truth.Truth.assertThat; 19 20 import android.os.SELinux; 21 import android.platform.test.annotations.RequiresFlagsEnabled; 22 import android.platform.test.flag.junit.CheckFlagsRule; 23 import android.platform.test.flag.junit.DeviceFlagsValueProvider; 24 25 import com.android.sdksandbox.flags.Flags; 26 import com.android.server.sdksandbox.DeviceSupportedBaseTest; 27 28 import org.junit.Rule; 29 import org.junit.Test; 30 import org.junit.runner.RunWith; 31 import org.junit.runners.JUnit4; 32 33 /** Tests to check some basic properties of the Sdk Sandbox next process. */ 34 @RunWith(JUnit4.class) 35 public class SdkSandboxNextTest extends DeviceSupportedBaseTest { 36 37 @Rule(order = 0) 38 public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule(); 39 40 @Test 41 @RequiresFlagsEnabled(Flags.FLAG_SELINUX_INPUT_SELECTOR) testSdkSandboxNextDomain()42 public void testSdkSandboxNextDomain() { 43 assertThat(SELinux.getContext()).contains("u:r:sdk_sandbox_next"); 44 } 45 } 46