test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
changeset 57584 9d82a35b6ff7
parent 57579 1edf6cc224fb
parent 57567 b000362a89a0
child 57705 7cf02b2c1455
equal deleted inserted replaced
57570:d7304cf430f1 57584:9d82a35b6ff7
   416         output = TestCommon.execCommon(execArgs);
   416         output = TestCommon.execCommon(execArgs);
   417         output.shouldContain("The shared archive file was created by a different version or build of HotSpot");
   417         output.shouldContain("The shared archive file was created by a different version or build of HotSpot");
   418         output.shouldNotContain("Checksum verification failed");
   418         output.shouldNotContain("Checksum verification failed");
   419 
   419 
   420         copyFile(orgJsaFile, jsa);
   420         copyFile(orgJsaFile, jsa);
       
   421         // modify _jvm_ident and run with -Xshare:auto
       
   422         System.out.println("\n2b. Corrupt _jvm_ident run with -Xshare:auto\n");
       
   423         modifyJvmIdent();
       
   424         output = TestCommon.execAuto(execArgs);
       
   425         output.shouldContain("The shared archive file was created by a different version or build of HotSpot");
       
   426         output.shouldContain("Hello World");
       
   427 
       
   428         copyFile(orgJsaFile, jsa);
   421         // modify _magic and _paths_misc_info_size, test should fail
   429         // modify _magic and _paths_misc_info_size, test should fail
   422         System.out.println("\n2b. Corrupt _magic and _paths_misc_info_size, should fail\n");
   430         System.out.println("\n2c. Corrupt _magic and _paths_misc_info_size, should fail\n");
   423         modifyHeaderIntField(offset_magic, 0x00000000);
   431         modifyHeaderIntField(offset_magic, 0x00000000);
   424         modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE);
   432         modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE);
   425         output = TestCommon.execCommon(execArgs);
   433         output = TestCommon.execCommon(execArgs);
   426         output.shouldContain("The shared archive file has a bad magic number");
   434         output.shouldContain("The shared archive file has a bad magic number");
   427         output.shouldNotContain("Checksum verification failed");
   435         output.shouldNotContain("Checksum verification failed");
   428 
   436 
   429         copyFile(orgJsaFile, jsa);
   437         copyFile(orgJsaFile, jsa);
   430         // modify _version and _paths_misc_info_size, test should fail
   438         // modify _version and _paths_misc_info_size, test should fail
   431         System.out.println("\n2c. Corrupt _version and _paths_misc_info_size, should fail\n");
   439         System.out.println("\n2d. Corrupt _version and _paths_misc_info_size, should fail\n");
   432         modifyHeaderIntField(offset_version, 0x00000000);
   440         modifyHeaderIntField(offset_version, 0x00000000);
   433         modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE);
   441         modifyHeaderIntField(offset_paths_misc_info_size, Integer.MAX_VALUE);
   434         output = TestCommon.execCommon(execArgs);
   442         output = TestCommon.execCommon(execArgs);
   435         output.shouldContain("The shared archive file has the wrong version");
   443         output.shouldContain("The shared archive file has the wrong version");
   436         output.shouldNotContain("Checksum verification failed");
   444         output.shouldNotContain("Checksum verification failed");