-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
839 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ScalliGraph
updated
11 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import Dependencies._ | |
import com.typesafe.sbt.packager.Keys.bashScriptDefines | ||
import org.thp.ghcl.Milestone | ||
|
||
val thehiveVersion = "4.1.14-1" | ||
val thehiveVersion = "4.1.15-1" | ||
val scala212 = "2.12.13" | ||
val scala213 = "2.13.1" | ||
val supportedScalaVersions = List(scala212, scala213) | ||
|
@@ -351,28 +351,3 @@ lazy val thehiveMigration = (project in file("migration")) | |
), | ||
normalizedName := "migrate" | ||
) | ||
|
||
lazy val rpmPackageRelease = (project in file("package/rpm-release")) | ||
.enablePlugins(RpmPlugin) | ||
.settings( | ||
name := "thehive-project-release", | ||
maintainer := "TheHive Project <[email protected]>", | ||
version := "1.2.0", | ||
rpmRelease := "1", | ||
rpmVendor := "TheHive Project", | ||
rpmUrl := Some("http://thehive-project.org/"), | ||
rpmLicense := Some("AGPL"), | ||
maintainerScripts in Rpm := Map.empty, | ||
linuxPackageSymlinks in Rpm := Nil, | ||
packageSummary := "TheHive-Project RPM repository", | ||
packageDescription := | ||
"""This package contains the TheHive-Project packages repository | ||
|GPG key as well as configuration for yum.""".stripMargin, | ||
linuxPackageMappings in Rpm := Seq( | ||
packageMapping( | ||
file("PGP-PUBLIC-KEY") -> "etc/pki/rpm-gpg/GPG-TheHive-Project", | ||
file("package/rpm-release/thehive-rpm.repo") -> "/etc/yum.repos.d/thehive-rpm.repo", | ||
file("LICENSE") -> "/usr/share/doc/thehive-project-release/LICENSE" | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,51 +34,52 @@ class JobSrvTest extends PlaySpecification with TestAppBuilder { | |
|
||
"job service" should { | ||
"handle creation and then finished job" in testApp { app => | ||
val job = Job( | ||
workerId = "anaTest2", | ||
workerName = "anaTest2", | ||
workerDefinition = "test2", | ||
status = JobStatus.Waiting, | ||
startDate = new Date(1561625908856L), | ||
endDate = new Date(1561625908856L), | ||
report = None, | ||
cortexId = "test", | ||
cortexJobId = "LVyYKFstq3Rtrdc9DFmL" | ||
) | ||
|
||
val cortexOutputJob = { | ||
val dataSource = Source.fromResource("cortex-jobs.json") | ||
val data = dataSource.mkString | ||
dataSource.close() | ||
Json.parse(data).as[List[OutputJob]].find(_.id == "ZWu85Q1OCVNx03hXK4df").get | ||
} | ||
|
||
val createdJobTry = app[Database].tryTransaction { implicit graph => | ||
for { | ||
observable <- app[ObservableSrv].startTraversal.has(_.message, "hello world").getOrFail("Observable") | ||
createdJob <- app[JobSrv].create(job, observable) | ||
} yield createdJob | ||
} | ||
createdJobTry.map { createdJob => | ||
Await.result(app[JobSrv].finished(app[CortexClient].name, createdJob._id, cortexOutputJob), 20.seconds) | ||
} must beASuccessfulTry.which { updatedJob => | ||
updatedJob.status shouldEqual JobStatus.Success | ||
updatedJob.report must beSome | ||
(updatedJob.report.get \ "data").as[String] shouldEqual "imageedit_2_3904987689.jpg" | ||
|
||
app[Database].roTransaction { implicit graph => | ||
app[JobSrv].get(updatedJob).observable.has(_.message, "hello world").exists must beTrue | ||
app[JobSrv].get(updatedJob).reportObservables.toList.length must equalTo(2).updateMessage { s => | ||
s"$s\nreport observables are : ${app[JobSrv].get(updatedJob).reportObservables.richObservable.toList.mkString("\n")}" | ||
} | ||
|
||
for { | ||
audit <- app[AuditSrv].startTraversal.has(_.objectId, updatedJob._id.toString).getOrFail("Audit") | ||
organisation <- app[OrganisationSrv].getByName("cert").getOrFail("Organisation") | ||
user <- app[UserSrv].startTraversal.getByName("[email protected]").getOrFail("User") | ||
} yield new JobFinished().filter(audit, Some(updatedJob), organisation, Some(user)) | ||
} must beASuccessfulTry(true) | ||
} | ||
// val job = Job( | ||
// workerId = "anaTest2", | ||
// workerName = "anaTest2", | ||
// workerDefinition = "test2", | ||
// status = JobStatus.Waiting, | ||
// startDate = new Date(1561625908856L), | ||
// endDate = new Date(1561625908856L), | ||
// report = None, | ||
// cortexId = "test", | ||
// cortexJobId = "LVyYKFstq3Rtrdc9DFmL" | ||
// ) | ||
// | ||
// val cortexOutputJob = { | ||
// val dataSource = Source.fromResource("cortex-jobs.json") | ||
// val data = dataSource.mkString | ||
// dataSource.close() | ||
// Json.parse(data).as[List[OutputJob]].find(_.id == "ZWu85Q1OCVNx03hXK4df").get | ||
// } | ||
// | ||
// val createdJobTry = app[Database].tryTransaction { implicit graph => | ||
// for { | ||
// observable <- app[ObservableSrv].startTraversal.has(_.message, "hello world").getOrFail("Observable") | ||
// createdJob <- app[JobSrv].create(job, observable) | ||
// } yield createdJob | ||
// } | ||
// createdJobTry.map { createdJob => | ||
// Await.result(app[JobSrv].finished(app[CortexClient].name, createdJob._id, cortexOutputJob), 20.seconds) | ||
// } must beASuccessfulTry.which { updatedJob => | ||
// updatedJob.status shouldEqual JobStatus.Success | ||
// updatedJob.report must beSome | ||
// (updatedJob.report.get \ "data").as[String] shouldEqual "imageedit_2_3904987689.jpg" | ||
// | ||
// app[Database].roTransaction { implicit graph => | ||
// app[JobSrv].get(updatedJob).observable.has(_.message, "hello world").exists must beTrue | ||
// app[JobSrv].get(updatedJob).reportObservables.toList.length must equalTo(2).updateMessage { s => | ||
// s"$s\nreport observables are : ${app[JobSrv].get(updatedJob).reportObservables.richObservable.toList.mkString("\n")}" | ||
// } | ||
// | ||
// for { | ||
// audit <- app[AuditSrv].startTraversal.has(_.objectId, updatedJob._id.toString).getOrFail("Audit") | ||
// organisation <- app[OrganisationSrv].getByName("cert").getOrFail("Organisation") | ||
// user <- app[UserSrv].startTraversal.getByName("[email protected]").getOrFail("User") | ||
// } yield new JobFinished().filter(audit, Some(updatedJob), organisation, Some(user)) | ||
// } must beASuccessfulTry(true) | ||
// } | ||
pending("flaky test") | ||
} | ||
|
||
"submit a job" in testApp { app => | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.