Revert "Verify that the VM-generated BCC is valid"

Revert "Fix encoding of PubKeyEd25519"

Revert submission 2101265-b/233338216

Reason for revert: Breaks tests: b/233588299
Reverted Changes:
I6f7a61ee3:Fix encoding of PubKeyEd25519
I544d9086f:Verify that the VM-generated BCC is valid

Change-Id: If784c6cd0b8b4eec35fd8554d5b122ce97a41e9b
diff --git a/compos/tests/Android.bp b/compos/tests/Android.bp
index b77a7e4..c178ddd 100644
--- a/compos/tests/Android.bp
+++ b/compos/tests/Android.bp
@@ -10,7 +10,6 @@
         "compatibility-tradefed",
         "compatibility-host-util",
     ],
-    data_native_bins: ["bcc_validator"],
     static_libs: [
         "VirtualizationTestHelper",
     ],
diff --git a/compos/tests/java/android/compos/test/ComposTestCase.java b/compos/tests/java/android/compos/test/ComposTestCase.java
index 51f0a1f..eec9e39 100644
--- a/compos/tests/java/android/compos/test/ComposTestCase.java
+++ b/compos/tests/java/android/compos/test/ComposTestCase.java
@@ -16,24 +16,17 @@
 
 package android.compos.test;
 
-import static android.virt.test.CommandResultSubject.assertThat;
-import static android.virt.test.CommandResultSubject.command_results;
-
 import static com.android.tradefed.testtype.DeviceJUnit4ClassRunner.TestLogData;
 
 import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth.assertWithMessage;
 
 import android.platform.test.annotations.RootPermissionTest;
 import android.virt.test.CommandRunner;
 import android.virt.test.VirtualizationTestCaseBase;
 
 import com.android.tradefed.log.LogUtil.CLog;
-import com.android.tradefed.result.FileInputStreamSource;
-import com.android.tradefed.result.LogDataType;
 import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
 import com.android.tradefed.util.CommandResult;
-import com.android.tradefed.util.RunUtil;
 
 import org.junit.After;
 import org.junit.Before;
@@ -42,8 +35,6 @@
 import org.junit.rules.TestName;
 import org.junit.runner.RunWith;
 
-import java.io.File;
-
 @RootPermissionTest
 @RunWith(DeviceJUnit4ClassRunner.class)
 public final class ComposTestCase extends VirtualizationTestCaseBase {
@@ -136,7 +127,7 @@
             long start = System.currentTimeMillis();
             CommandResult result = runOdrefresh(android, "--force-compile");
             long elapsed = System.currentTimeMillis() - start;
-            assertThat(result).exitCode().isEqualTo(COMPILATION_SUCCESS);
+            assertThat(result.getExitCode()).isEqualTo(COMPILATION_SUCCESS);
             CLog.i("Local compilation took " + elapsed + "ms");
         }
 
@@ -146,7 +137,12 @@
 
         // --check may delete the output.
         CommandResult result = runOdrefresh(android, "--check");
-        assertThat(result).exitCode().isEqualTo(OKAY);
+        assertThat(result.getExitCode()).isEqualTo(OKAY);
+
+        // Make sure we generate a fresh instance.
+        android.tryRun("rm", "-rf", COMPOS_TEST_ROOT);
+        // TODO: remove once composd starts to clean up the directory.
+        android.tryRun("rm", "-rf", ODREFRESH_OUTPUT_DIR);
 
         // Expect the compilation in Compilation OS to finish successfully.
         {
@@ -155,14 +151,11 @@
                     android.runForResultWithTimeout(
                             ODREFRESH_TIMEOUT_MS, COMPOSD_CMD_BIN, "test-compile");
             long elapsed = System.currentTimeMillis() - start;
-            assertThat(result).exitCode().isEqualTo(0);
+            assertThat(result.getExitCode()).isEqualTo(0);
             CLog.i("Comp OS compilation took " + elapsed + "ms");
         }
         killVmAndReconnectAdb();
 
-        // Expect the BCC extracted from the BCC to be well-formed.
-        assertVmBccIsValid();
-
         // Save the actual checksum for the output directory.
         String actualChecksumSnapshot = checksumDirectoryContentPartial(android,
                 ODREFRESH_OUTPUT_DIR);
@@ -178,24 +171,6 @@
         android.run(COMPOS_VERIFY_BIN + " --debug --instance test");
     }
 
-    private void assertVmBccIsValid() throws Exception {
-        File bcc_file = getDevice().pullFile(COMPOS_APEXDATA_DIR + "/test/bcc");
-        assertThat(bcc_file).isNotNull();
-
-        // Add the BCC to test artifacts, in case it is ill-formed or otherwise interesting.
-        mTestLogs.addTestLog(bcc_file.getPath(), LogDataType.UNKNOWN,
-                new FileInputStreamSource(bcc_file));
-
-        // Find the validator binary - note that it's specified as a dependency in our Android.bp.
-        File validator = getTestInformation().getDependencyFile("bcc_validator", /*targetFirst=*/
-                false);
-
-        CommandResult result = new RunUtil().runTimedCmd(10000,
-                validator.getAbsolutePath(), "verify-chain", bcc_file.getAbsolutePath());
-        assertWithMessage("bcc_validator failed").about(command_results())
-                .that(result).isSuccess();
-    }
-
     private CommandResult runOdrefresh(CommandRunner android, String command) throws Exception {
         return android.runForResultWithTimeout(
                 ODREFRESH_TIMEOUT_MS,