Migrate file system tests to CTSv2

bug:21762834
Change-Id: I361864f427fe37799b8e577157f50613af010c20
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index 932e8c0..75db5ea 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -128,7 +128,6 @@
 
 # Test packages that require an associated test package XML.
 cts_test_packages := \
-    CtsDeviceFilePerf \
     CtsDeviceUi \
     CtsDeviceSimpleCpu \
     CtsDeviceVideoPerf \
@@ -157,6 +156,7 @@
     CtsDreamsTestCases \
     CtsDrmTestCases \
     CtsEffectTestCases \
+    CtsFileSystemTestCases \
     CtsGestureTestCases \
     CtsGraphicsTestCases \
     CtsGraphics2TestCases \
diff --git a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java b/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java
deleted file mode 100644
index 052c054..0000000
--- a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/TestTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-
-
-// code for testing, will be removed / moved before release
-
-package com.android.cts.filesystemperf;
-
-import android.cts.util.CtsAndroidTestCase;
-
-/**
- * This class is for testing CTS logging. Will be disabled in release.
- *
- */
-public class TestTest extends CtsAndroidTestCase {
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-/* code for testing CTS logging. Disabled.
-    @TimeoutReq(minutes = 15)
-    public void testPass() {
-        double[] array = new double[] {1.0, 2.0, 3.0};
-        getReportLog().printArray(" ", array, true);
-        getReportLog().printArray(" ", array, false);
-        getReportLog().printValue(" ", 1.0);
-        getReportLog().printValue(" ", 2.0);
-        getReportLog().printSummary("This should be shown", 0, 0);
-    }
-
-    @TimeoutReq(minutes = 10)
-    public void testFail() throws Exception {
-        getReportLog().printValue(" ", 1.0);
-        getReportLog().printValue(" ", 2.0);
-        getReportLog().printSummary("This should not be shown", 0, 0);
-        throw new Exception("failed");
-    }
-*/
-}
diff --git a/suite/cts/deviceTests/filesystemperf/Android.mk b/tests/filesystem/Android.mk
similarity index 87%
rename from suite/cts/deviceTests/filesystemperf/Android.mk
rename to tests/filesystem/Android.mk
index b98971b..00e5ee7 100644
--- a/suite/cts/deviceTests/filesystemperf/Android.mk
+++ b/tests/filesystem/Android.mk
@@ -22,7 +22,10 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := CtsDeviceFilePerf
+LOCAL_PACKAGE_NAME := CtsFileSystemTestCases
+
+# Tag this module as a cts_v2 test artifact
+LOCAL_COMPATIBILITY_SUITE := cts_v2
 
 LOCAL_SDK_VERSION := 16
 
diff --git a/suite/cts/deviceTests/filesystemperf/AndroidManifest.xml b/tests/filesystem/AndroidManifest.xml
similarity index 86%
rename from suite/cts/deviceTests/filesystemperf/AndroidManifest.xml
rename to tests/filesystem/AndroidManifest.xml
index 329bf19..c02ac77 100644
--- a/suite/cts/deviceTests/filesystemperf/AndroidManifest.xml
+++ b/tests/filesystem/AndroidManifest.xml
@@ -15,7 +15,7 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.cts.filesystemperf">
+        package="android.filesystem.cts">
 
     <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -24,6 +24,6 @@
         <uses-library android:name="android.test.runner" />
     </application>
     <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
-            android:targetPackage="com.android.cts.filesystemperf"
-            android:label="UI Latency measurement" />
+            android:targetPackage="android.filesystem.cts"
+            android:label="CTS tests for file system" />
 </manifest>
diff --git a/tests/filesystem/AndroidTest.xml b/tests/filesystem/AndroidTest.xml
new file mode 100644
index 0000000..65d4296
--- /dev/null
+++ b/tests/filesystem/AndroidTest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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="Config for CTS File System Test Cases">
+    <include name="common-config" />
+    <option name="apk-installer:test-file-name" value="CtsFileSystemTestCases.apk" />
+    <test class="com.android.tradefed.testtype.InstrumentationTest" >
+        <option name="package" value="android.filesystem.cts" />
+        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+    </test>
+</configuration>
\ No newline at end of file
diff --git a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java b/tests/filesystem/src/android/filesystem/cts/AlmostFullTest.java
similarity index 98%
rename from suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java
rename to tests/filesystem/src/android/filesystem/cts/AlmostFullTest.java
index 604dbcd..991f9bf 100644
--- a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/AlmostFullTest.java
+++ b/tests/filesystem/src/android/filesystem/cts/AlmostFullTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.filesystemperf;
+package android.filesystem.cts;
 
 import android.util.Log;
 
diff --git a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java b/tests/filesystem/src/android/filesystem/cts/FileUtil.java
similarity index 99%
rename from suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java
rename to tests/filesystem/src/android/filesystem/cts/FileUtil.java
index 3ab34e7..baefaa0 100755
--- a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/FileUtil.java
+++ b/tests/filesystem/src/android/filesystem/cts/FileUtil.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.filesystemperf;
+package android.filesystem.cts;
 
 import android.content.Context;
 import android.cts.util.SystemUtil;
diff --git a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java b/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
similarity index 97%
rename from suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java
rename to tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
index 08c1c77..dff3723 100644
--- a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/RandomRWTest.java
+++ b/tests/filesystem/src/android/filesystem/cts/RandomRWTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.filesystemperf;
+package android.filesystem.cts;
 
 import android.cts.util.CtsAndroidTestCase;
 
diff --git a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java b/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
similarity index 98%
rename from suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java
rename to tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
index 6cf41f5..3b7a45f 100644
--- a/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/SequentialRWTest.java
+++ b/tests/filesystem/src/android/filesystem/cts/SequentialRWTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.cts.filesystemperf;
+package android.filesystem.cts;
 
 import android.cts.util.CtsAndroidTestCase;
 
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index 0c87e07..b8ea78a 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -341,6 +341,7 @@
       'android.dreams' : [],
       'android.drm' : [],
       'android.effect' : [],
+      'android.filesystem' : [],
       'android.gesture' : [],
       'android.graphics' : [],
       'android.graphics2' : [],
@@ -369,7 +370,6 @@
       'android.theme' : [],
       'android.usb' : [],
       'android.util' : [],
-      'com.android.cts.filesystemperf' : [],
       'com.android.cts.jank' : [],
       'com.android.cts.jank2' : [],
       'com.android.cts.opengl' : [],