sqlcipher/sqlcipher-android-tests

Repetitive testing option

Closed this issue · 5 comments

I was able to automatically repeat the testing through 10 9 rounds with the following changes which are very primitive:

--- a/src/main/java/net/zetetic/tests/TestSuiteRunner.java
+++ b/src/main/java/net/zetetic/tests/TestSuiteRunner.java
@@ -42,9 +42,20 @@ public class TestSuiteRunner extends AsyncTask<ResultNotifier, TestResult, Void>
         }
     }

-    private List<SQLCipherTest> getTestsToRun(){
+    private List<SQLCipherTest> getTestsToRun() {
         List<SQLCipherTest> tests = new ArrayList<SQLCipherTest>();

+        //addTests(tests);
+
+        for (int i=1; i<10; ++i) {
+            tests.add(new RoundMarkerTest(i));
+            addTests(tests);
+        }
+
+        return tests;
+    }
+
+    private void addTests(List<SQLCipherTest> tests) {
         tests.add(new AttachDatabaseTest());
         tests.add(new CipherMigrateTest());
         tests.add(new GetTypeFromCrossProcessCursorWrapperTest());
@@ -86,7 +97,23 @@ public class TestSuiteRunner extends AsyncTask<ResultNotifier, TestResult, Void>
         tests.add(new RawRekeyTest());
         tests.add(new ClosedDatabaseTest());
         tests.add(new CorruptDatabaseTest());
+    }

-        return tests;
+    class RoundMarkerTest extends SQLCipherTest {
+        final int testRound;
+
+        RoundMarkerTest(int test_round) {
+            testRound = test_round;
+        }
+
+        @Override
+        public boolean execute(SQLiteDatabase database) {
+            return true;
+        }
+
+        @Override
+        public String getName() {
+            return "Test round " + testRound;
+        }
     }
 }

Unfortunately, if the screen locks, the testing app will crash when I unlock the screen.

Also, the Cipher Migrate test only passes the first time.

Better to have an extra button to repeat the test suite (or a part of it) for a period of several hours. Even better would be to run multiple tests in parallel threads and see how it holds up.

@brodybits interesting, I wonder if the failure is just due to improper clean up of database files. We should probably expunge the working directory of database files at the end of each test if we are not already, I would need to verify.

stale commented

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

I think it would be nice if we can add some more stability testing:)

stale commented

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

stale commented

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.