mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-20 05:28:22 +00:00
[#12] Setup basic Travis CI build
This commit is contained in:
parent
eced951933
commit
00b1c913e4
26
.travis.yml
Normal file
26
.travis.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
os:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
sudo: true
|
||||||
|
|
||||||
|
language: java
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- docker build -t hirs-centos7 .
|
||||||
|
|
||||||
|
before_cache:
|
||||||
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||||
|
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.gradle/caches/
|
||||||
|
- $HOME/.gradle/wrapper/
|
||||||
|
|
||||||
|
install: true
|
||||||
|
|
||||||
|
script:
|
||||||
|
- docker run --rm hirs-centos7 /bin/bash -c "cd /root/HIRS; git checkout ${TRAVIS_BRANCH}; make -C tpm_module/"
|
||||||
|
- docker run --rm hirs-centos7 /bin/bash -c "cd /root/HIRS; git checkout ${TRAVIS_BRANCH}; ./gradlew build"
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM centos:7.5.1804
|
||||||
|
|
||||||
|
MAINTAINER apl.dev3@jhuapl.edu
|
||||||
|
|
||||||
|
# Install packages for building HIRS
|
||||||
|
RUN yum -y update && yum clean all
|
||||||
|
RUN yum install -y java-1.8.0-openjdk-devel epel-release cmake make git gcc-c++ doxygen graphviz python libssh2-devel openssl protobuf-compiler protobuf-devel tpm2-tss-devel trousers-devel
|
||||||
|
RUN yum install -y cppcheck log4cplus-devel re2-devel
|
||||||
|
|
||||||
|
# Set Environment Variables
|
||||||
|
ENV JAVA_HOME /usr/lib/jvm/java
|
||||||
|
|
||||||
|
# Download HIRS Project
|
||||||
|
RUN git clone https://github.com/nsacyber/HIRS.git /root/HIRS
|
@ -16,6 +16,8 @@ import java.nio.file.Path;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.bouncycastle.util.encoders.Base64;
|
import org.bouncycastle.util.encoders.Base64;
|
||||||
|
|
||||||
import static org.testng.Assert.fail;
|
import static org.testng.Assert.fail;
|
||||||
@ -187,11 +189,12 @@ public class PlatformCredentialTest {
|
|||||||
|
|
||||||
PlatformCredential credential = new PlatformCredential(certPath);
|
PlatformCredential credential = new PlatformCredential(certPath);
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(2017, 2, 23, 18, 34, 33);
|
calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
calendar.set(2017, 2, 23, 22, 34, 33);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
Assert.assertEquals(credential.getBeginValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getBeginValidity().getTime(), calendar.getTime().getTime());
|
||||||
calendar.set(2030, 11, 31, 18, 59, 59);
|
calendar.set(2030, 11, 31, 23, 59, 59);
|
||||||
Assert.assertEquals(credential.getEndValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getEndValidity().getTime(), calendar.getTime().getTime());
|
||||||
|
|
||||||
Assert.assertNotNull(credential.getAttributeCertificate());
|
Assert.assertNotNull(credential.getAttributeCertificate());
|
||||||
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
||||||
@ -235,11 +238,12 @@ public class PlatformCredentialTest {
|
|||||||
|
|
||||||
PlatformCredential credential = new PlatformCredential(certPath);
|
PlatformCredential credential = new PlatformCredential(certPath);
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(2017, 2, 23, 18, 34, 33);
|
calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
calendar.set(2017, 2, 23, 22, 34, 33);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
Assert.assertEquals(credential.getBeginValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getBeginValidity().getTime(), calendar.getTime().getTime());
|
||||||
calendar.set(2030, 11, 31, 18, 59, 59);
|
calendar.set(2030, 11, 31, 23, 59, 59);
|
||||||
Assert.assertEquals(credential.getEndValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getEndValidity().getTime(), calendar.getTime().getTime());
|
||||||
|
|
||||||
Assert.assertNotNull(credential.getAttributeCertificate());
|
Assert.assertNotNull(credential.getAttributeCertificate());
|
||||||
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
||||||
@ -283,11 +287,12 @@ public class PlatformCredentialTest {
|
|||||||
PlatformCredential credential = new PlatformCredential(certPath);
|
PlatformCredential credential = new PlatformCredential(certPath);
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(2017, 3, 21, 13, 5, 29);
|
calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
calendar.set(2017, 3, 21, 17, 5, 29);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
Assert.assertEquals(credential.getBeginValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getBeginValidity().getTime(), calendar.getTime().getTime());
|
||||||
calendar.set(2030, 11, 31, 18, 59, 59);
|
calendar.set(2030, 11, 31, 23, 59, 59);
|
||||||
Assert.assertEquals(credential.getEndValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getEndValidity().getTime(), calendar.getTime().getTime());
|
||||||
|
|
||||||
Assert.assertNotNull(credential.getAttributeCertificate());
|
Assert.assertNotNull(credential.getAttributeCertificate());
|
||||||
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
||||||
@ -327,11 +332,12 @@ public class PlatformCredentialTest {
|
|||||||
PlatformCredential credential = new PlatformCredential(certPath);
|
PlatformCredential credential = new PlatformCredential(certPath);
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(2017, 3, 21, 13, 5, 30);
|
calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
calendar.set(2017, 3, 21, 17, 5, 30);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
Assert.assertEquals(credential.getBeginValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getBeginValidity().getTime(), calendar.getTime().getTime());
|
||||||
calendar.set(2030, 11, 31, 18, 59, 59);
|
calendar.set(2030, 11, 31, 23, 59, 59);
|
||||||
Assert.assertEquals(credential.getEndValidity(), calendar.getTime());
|
Assert.assertEquals(credential.getEndValidity().getTime(), calendar.getTime().getTime());
|
||||||
|
|
||||||
Assert.assertNotNull(credential.getAttributeCertificate());
|
Assert.assertNotNull(credential.getAttributeCertificate());
|
||||||
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
byte[] sig = credential.getAttributeCertificate().getSignatureValue().getBytes();
|
||||||
|
@ -44,6 +44,12 @@ subprojects {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
testLogging {
|
||||||
|
exceptionFormat = 'full'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test) {
|
||||||
useTestNG() {
|
useTestNG() {
|
||||||
includeGroups = project.ext.includeGroups.split()
|
includeGroups = project.ext.includeGroups.split()
|
||||||
|
Loading…
Reference in New Issue
Block a user