CTS test for 'fullBackupOnly' manifest attribute
Uses 3 different versions of the same app that differ only by
'fullBackupOnly' value and the presence/absence of the backup agent.
Tests the following scenarios:
1. App that doesn't have fullBackupOnly (same as fullBackupOnly=false by
default) and has a backup agent will get key/value backup.
We check that key/value data was restored after reinstall and dolly data was not.
2. App that doesn't have fullBackupOnly (same as fullBackupOnly=false by
default) and has no backup agent will get Dolly backup.
We check that key/value data was not restored after reinstall and dolly data was.
3. App that has fullBackupOnly=true and has a backup agent will only
get Dolly backup.
We check that key/value data was not restored after reinstall and dolly data was.
The flow of the tests is the following:
1. Install the app
2. Generate files in data folder of the app, including a file in
no_backup folder. The file in no_backup folder is used for key/value backup by
the backup agent of the app.
3. Run 'bmgr backupnow'. Depending on the manifest of the app we expect
either Dolly or Key/value backup to be performed.
4. Uninstall and reinstall the app.
5. Check that the correct files were restored depending on the manifest:
- Files in the app's data folder for Dolly backup
- Only file in no_backup folder for key/value.
Test: cts-tradefed run cts-dev -m CtsBackupHostTestCases -t android.cts.backup.FullBackupOnlyHostSideTest
Bug: 38108587
Change-Id: If29577a5209fc77cebebe23dc879c51ab4be5e65
diff --git a/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk
new file mode 100644
index 0000000..5cce7a4
--- /dev/null
+++ b/hostsidetests/backup/FullBackupOnly/FullBackupOnlyFalseNoAgentApp/Android.mk
@@ -0,0 +1,39 @@
+# Copyright (C) 2017 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.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+# Don't include this package in any target
+LOCAL_MODULE_TAGS := tests
+# When built, explicitly put it in the data partition.
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
+LOCAL_DEX_PREOPT := false
+
+LOCAL_PROGUARD_ENABLED := disabled
+
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
+LOCAL_SRC_FILES := $(call all-java-files-under, ../src)
+
+# tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts
+
+LOCAL_PACKAGE_NAME := FullBackupOnlyFalseNoAgentApp
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)