From 00baa4b4fc14b9a6ffab4f62663caa10d50873e1 Mon Sep 17 00:00:00 2001 From: Richard Uhler Date: Mon, 11 Feb 2019 10:11:43 +0000 Subject: [PATCH] Stub out code for a host driven StagedRollbackTest. The test doesn't test anything meaningful yet, but it builds and runs. Bug: 124043688 Test: atest StagedRollbackTest Change-Id: If9b5d57e28846b0ba28a580b74a486bbedb8f8d5 --- tests/RollbackTest/Android.mk | 10 +++++ tests/RollbackTest/README.txt | 4 ++ tests/RollbackTest/StagedRollbackTest.xml | 25 ++++++++++++ .../rollback/host/StagedRollbackTest.java | 38 +++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 tests/RollbackTest/StagedRollbackTest.xml create mode 100644 tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java diff --git a/tests/RollbackTest/Android.mk b/tests/RollbackTest/Android.mk index 0c910fe3fed0f..0967ad3767c63 100644 --- a/tests/RollbackTest/Android.mk +++ b/tests/RollbackTest/Android.mk @@ -89,6 +89,16 @@ LOCAL_SDK_VERSION := system_current LOCAL_TEST_CONFIG := RollbackTest.xml include $(BUILD_PACKAGE) +# StagedRollbackTest +include $(CLEAR_VARS) +LOCAL_SRC_FILES := $(call all-java-files-under, StagedRollbackTest/src) +LOCAL_MODULE := StagedRollbackTest +LOCAL_MODULE_TAGS := tests +LOCAL_JAVA_LIBRARIES := tradefed +LOCAL_COMPATIBILITY_SUITE := general-tests +LOCAL_TEST_CONFIG := StagedRollbackTest.xml +include $(BUILD_HOST_JAVA_LIBRARY) + # Clean up local variables ROLLBACK_TEST_APP_AV1 := ROLLBACK_TEST_APP_AV2 := diff --git a/tests/RollbackTest/README.txt b/tests/RollbackTest/README.txt index 110088b9febe4..c0b718a3e2c1a 100644 --- a/tests/RollbackTest/README.txt +++ b/tests/RollbackTest/README.txt @@ -5,6 +5,9 @@ Directory structure RollbackTest - device driven test for rollbacks not involving staged rollbacks. +StagedRollbackTest + - device driven test for staged rollbacks. + TestApp - source for dummy apks used in testing. @@ -17,3 +20,4 @@ Running the tests You can manually run the tests as follows: atest RollbackTest + atest StagedRollbackTest diff --git a/tests/RollbackTest/StagedRollbackTest.xml b/tests/RollbackTest/StagedRollbackTest.xml new file mode 100644 index 0000000000000..2750d3765c20b --- /dev/null +++ b/tests/RollbackTest/StagedRollbackTest.xml @@ -0,0 +1,25 @@ + + + + diff --git a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java new file mode 100644 index 0000000000000..5c006931128c9 --- /dev/null +++ b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.tests.rollback.host; + +import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; +import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; + +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Runs the staged rollback tests. + */ +@RunWith(DeviceJUnit4ClassRunner.class) +public class StagedRollbackTest extends BaseHostJUnit4Test { + + /** + * Tests staged rollbacks. + */ + @Test + public void testStagedRollback() { + // TODO: Actually test staged rollbacks. + } +}