mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
Add test for Java cataloging with no main package
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
parent
7bcdafe745
commit
ae7cd6bbb7
2 changed files with 43 additions and 0 deletions
20
test/integration/java_no_main_package_test.go
Normal file
20
test/integration/java_no_main_package_test.go
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package integration
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/anchore/stereoscope/pkg/imagetest"
|
||||||
|
"github.com/anchore/syft/syft"
|
||||||
|
"github.com/anchore/syft/syft/source"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestJavaNoMainPackage(t *testing.T) { // Regression: https://github.com/anchore/syft/issues/252
|
||||||
|
fixtureImageName := "image-java-no-main-package"
|
||||||
|
_, cleanup := imagetest.GetFixtureImage(t, "docker-archive", fixtureImageName)
|
||||||
|
tarPath := imagetest.GetFixtureImageTarPath(t, fixtureImageName)
|
||||||
|
defer cleanup()
|
||||||
|
|
||||||
|
_, _, _, err := syft.Catalog("docker-archive:"+tarPath, source.SquashedScope)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to catalog image: %+v", err)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
FROM jenkins:2.60.3
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
WORKDIR /usr/share/jenkins
|
||||||
|
|
||||||
|
RUN mkdir tmp
|
||||||
|
|
||||||
|
WORKDIR /usr/share/jenkins/tmp
|
||||||
|
|
||||||
|
RUN apt-get update 2>&1 > /dev/null && apt-get install -y less zip 2>&1 > /dev/null
|
||||||
|
|
||||||
|
RUN unzip ../jenkins.war 2>&1 > /dev/null
|
||||||
|
|
||||||
|
RUN rm -f ./META-INF/MANIFEST.MF
|
||||||
|
|
||||||
|
WORKDIR /usr/share/jenkins
|
||||||
|
|
||||||
|
RUN rm -rf jenkins.war
|
||||||
|
|
||||||
|
RUN cd ./tmp && zip -r ../jenkins.war . && cd ..
|
||||||
|
|
||||||
|
RUN rm -rf ./tmp
|
Loading…
Reference in a new issue