1 /* 2 * Copyright (C) 2022 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 17 package android.net.vcn.cts; 18 19 import static org.junit.Assert.assertEquals; 20 21 import android.net.vcn.VcnUnderlyingNetworkTemplate; 22 23 public class VcnUnderlyingNetworkTemplateTestBase { 24 protected static final int MIN_ENTRY_DOWN_BANDWIDTH_KBPS = 4000; 25 protected static final int MIN_EXIT_DOWN_BANDWIDTH_KBPS = 3000; 26 protected static final int MIN_ENTRY_UP_BANDWIDTH_KBPS = 2000; 27 protected static final int MIN_EXIT_UP_BANDWIDTH_KBPS = 1000; 28 verifyBandwidthsWithTestValues( VcnUnderlyingNetworkTemplate networkTemplate)29 protected static void verifyBandwidthsWithTestValues( 30 VcnUnderlyingNetworkTemplate networkTemplate) { 31 assertEquals( 32 MIN_ENTRY_DOWN_BANDWIDTH_KBPS, 33 networkTemplate.getMinEntryDownstreamBandwidthKbps()); 34 assertEquals( 35 MIN_EXIT_DOWN_BANDWIDTH_KBPS, networkTemplate.getMinExitDownstreamBandwidthKbps()); 36 assertEquals( 37 MIN_ENTRY_UP_BANDWIDTH_KBPS, networkTemplate.getMinEntryUpstreamBandwidthKbps()); 38 assertEquals(MIN_EXIT_UP_BANDWIDTH_KBPS, networkTemplate.getMinExitUpstreamBandwidthKbps()); 39 } 40 verifyBandwidthsWithDefaultValues( VcnUnderlyingNetworkTemplate networkTemplate)41 protected static void verifyBandwidthsWithDefaultValues( 42 VcnUnderlyingNetworkTemplate networkTemplate) { 43 assertEquals(0, networkTemplate.getMinEntryDownstreamBandwidthKbps()); 44 assertEquals(0, networkTemplate.getMinEntryDownstreamBandwidthKbps()); 45 assertEquals(0, networkTemplate.getMinEntryUpstreamBandwidthKbps()); 46 assertEquals(0, networkTemplate.getMinEntryUpstreamBandwidthKbps()); 47 } 48 } 49