GT-2658 changed GhidraServer build to include placeholder lib and os

dirs
This commit is contained in:
ghidra1 2019-09-06 14:58:42 -04:00
parent 58f93ea0e7
commit aaf655db35
5 changed files with 69 additions and 3 deletions

View file

@ -109,6 +109,9 @@ rootProject.assembleDistribution {
with yajswCopySpec with yajswCopySpec
from generateGhidraServerClasspath from generateGhidraServerClasspath
} }
into (getZipPath(this.project) + "/os") {
from (projectDir.toString() + "/os")
}
} }
/********************************************************************************* /*********************************************************************************

View file

@ -5,6 +5,5 @@
Module.manifest||GHIDRA||||END| Module.manifest||GHIDRA||||END|
build.gradle||GHIDRA||||END| build.gradle||GHIDRA||||END|
data/jaas-modules-src-1.0.3.zip||LGPL 2.1|||File corresponds to original distribution with all binary product files removed.|END| data/jaas-modules-src-1.0.3.zip||LGPL 2.1|||File corresponds to original distribution with all binary product files removed.|END|
data/lib/readme.txt||GHIDRA||||END| os/readme.txt||GHIDRA||||END|
data/os/readme.txt||GHIDRA||||END|
src/main/java/ghidra/server/remote/ServerHelp.txt||GHIDRA||||END| src/main/java/ghidra/server/remote/ServerHelp.txt||GHIDRA||||END|

View file

@ -1 +0,0 @@
This directory is for additional JAVA libraries (*.jar) that you want to make available to GhidraServer.

View file

@ -0,0 +1,65 @@
/* ###
* IP: GHIDRA
*
* 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.
*/
package ghidra.util.timer;
import static org.junit.Assert.*;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Test;
import generic.test.AbstractGTest;
import ghidra.util.Msg;
import ghidra.util.timer.Watchdog;
public class WatchdogTest extends AbstractGTest {
@Test(timeout = 20000)
public void test() {
long watchdogTimeoutMS = 10;
// watchdog could take N*2 to trigger
long watchdogMaxIntrMS = watchdogTimeoutMS * 3;
AtomicBoolean inerruptedFlag = new AtomicBoolean();
Thread testThread = Thread.currentThread();
try (Watchdog watchDog = new Watchdog(watchdogTimeoutMS, () -> {
Msg.trace(this, "" + System.currentTimeMillis() + ": Interrupting the test thread...");
inerruptedFlag.set(true);
testThread.interrupt();
})) {
for (int i = 0; i < 10; i++) {
inerruptedFlag.set(false);
watchDog.arm();
long start = System.currentTimeMillis();
try {
Thread.sleep(DEFAULT_WAIT_TIMEOUT);
fail(System.currentTimeMillis() + ": Watchdog did not fire");
}
catch (InterruptedException e) {
assertTrue("" + System.currentTimeMillis() +
": Sleep was interrupted, but not by watchdog", inerruptedFlag.get());
long elapsed = System.currentTimeMillis() - start;
Msg.trace(this, System.currentTimeMillis() + ": Watchdog fired in: " + elapsed +
"ms, max target is: " + watchdogMaxIntrMS + "ms");
}
}
}
}
}