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
This commit is contained in:
Richard Uhler
2019-02-11 10:11:43 +00:00
parent 8ab0ee8c83
commit 00baa4b4fc
4 changed files with 77 additions and 0 deletions

View File

@@ -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 :=

View File

@@ -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

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<configuration description="Runs the staged rollback tests">
<option name="test-suite-tag" value="StagedRollbackTest" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="RollbackTest.apk" />
</target_preparer>
<test class="com.android.tradefed.testtype.HostTest" >
<option name="class" value="com.android.tests.rollback.host.StagedRollbackTest" />
</test>
</configuration>

View File

@@ -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.
}
}