mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-12 22:26:14 -04:00
Save few integration tests
This commit is contained in:
parent
fa236cb1ad
commit
66e7338fa5
5 changed files with 235 additions and 0 deletions
60
src/test/java/integration/FsIntegrationTest.java
Normal file
60
src/test/java/integration/FsIntegrationTest.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
/* Copyright WTFPL */
|
||||
package integration;
|
||||
|
||||
import nsusbloader.NSLMain;
|
||||
import nsusbloader.Utilities.patches.fs.FsPatchMaker;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class FsIntegrationTest {
|
||||
static String pathToFirmware;
|
||||
static String pathToFirmwares;
|
||||
static String pathToKeysFile;
|
||||
static String saveTo;
|
||||
|
||||
@BeforeAll
|
||||
static void init() throws Exception{
|
||||
NSLMain.isCli = true;
|
||||
Environment environment = new Environment();
|
||||
pathToKeysFile = environment.getProdkeysLocation();
|
||||
saveTo = environment.getSaveToLocation() + File.separator + "FS_LPR";
|
||||
pathToFirmwares = environment.getFirmwaresLocation();
|
||||
pathToFirmware = pathToFirmware + File.separator + "Firmware 13.0.0";
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@DisplayName("FS Integration validation - everything")
|
||||
@Test
|
||||
void makeFss() throws Exception{
|
||||
File[] fwDirs = new File(pathToFirmwares).listFiles((file, s) -> {
|
||||
return (s.matches("^Firmware (9\\.|[0-9][0-9]\\.).*") && ! s.endsWith(".zip"));
|
||||
//return s.matches("^Firmware 10.0.1.*");
|
||||
});
|
||||
assert fwDirs != null;
|
||||
Arrays.sort(fwDirs);
|
||||
|
||||
for (File dir : fwDirs){
|
||||
System.out.println("\n\t\t\t"+dir.getName());
|
||||
FsPatchMaker fsPatchMaker = new FsPatchMaker(dir.getAbsolutePath(), pathToKeysFile, saveTo);
|
||||
Thread workThread = new Thread(fsPatchMaker);
|
||||
workThread.start();
|
||||
workThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@DisplayName("FS Integration validation - one particular firmware")
|
||||
@Test
|
||||
void makeFs() throws Exception{
|
||||
System.out.println(pathToFirmware);
|
||||
FsPatchMaker fsPatchMaker = new FsPatchMaker(pathToFirmware, pathToKeysFile, saveTo);
|
||||
Thread workThread = new Thread(fsPatchMaker);
|
||||
workThread.start();
|
||||
workThread.join();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue