Skip to content

Commit

Permalink
Add EOL to e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
  • Loading branch information
robert-cronin committed Jan 9, 2025
1 parent bf7bc1d commit 958be3f
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 2 deletions.
11 changes: 11 additions & 0 deletions demo/graphql/queries.gql
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,15 @@ query CertifyLegalQ1 {
CertifyLegal(certifyLegalSpec: {subject: {package: {name: "log4j-core"} } }) @filter(keyName: "collector", operation: CONTAINS, value: "clearlydefined") {
...allCertifyLegalTree
}
}


query EndOfLifeQ1 {
HasMetadata(hasMetadataSpec: {subject: {package: {type: "deb", namespace: "debian", name: "openssl", version: "1.1.1n-0+deb11u3"}}}) @filter(keyName: "key", operation: CONTAINS, value: "endoflife") {
subject {
...allPkgTree
}
key
value
}
}
6 changes: 4 additions & 2 deletions internal/testing/e2e/e2e
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ wipe_data() {
fi
}

go run ${GUAC_DIR}"/cmd/guacingest" --add-vuln-on-ingest=true --add-license-on-ingest &
go run ${GUAC_DIR}"/cmd/guacingest" --add-vuln-on-ingest=true --add-license-on-ingest --add-eol-on-ingest &
go run ${GUAC_DIR}"/cmd/guacone" collect deps_dev -p &
go run ${GUAC_DIR}"/cmd/guaccsub" &

# Define ingestion commands
declare -a ingestion_commands=(
"go run ${GUAC_DIR}/cmd/guacone collect files ${GUAC_DIR}/guac-data/docs/ --add-vuln-on-ingest=true --add-license-on-ingest"
"go run ${GUAC_DIR}/cmd/guacone collect files ${GUAC_DIR}/guac-data/docs/ --add-vuln-on-ingest=true --add-license-on-ingest --add-eol-on-ingest"
"go run ${GUAC_DIR}/cmd/guaccollect files ${GUAC_DIR}/guac-data/docs/ --service-poll=false"
)

Expand All @@ -121,6 +121,7 @@ queryValues["CertifyVulnQ1"]='del(.. | .id?) | del(.. | .timeScanned?)'
queryValues["ArtifactsQ1"]='.artifacts |= sort'
queryValues["PkgQ9"]='.packages[].namespaces |= sort_by(.namespace) | .packages[].namespaces[].names[].versions |= sort_by(.id) | .packages[].namespaces[].names[].versions[].qualifiers |= sort_by(.key) | del(.. | .id?)'
queryValues["CertifyLegalQ1"]='del(.. | .id?) | del(.. | .timeScanned?) | del(.. | .origin?)'
queryValues["EndOfLifeQ1"]='del(.. | .id?) | del(.. | .timeScanned?) | del(.. | .origin?)'

# Define an indexed array to maintain the order of the queries
queryOrder=(
Expand All @@ -136,6 +137,7 @@ queryOrder=(
"ArtifactsQ1"
"PkgQ9"
"CertifyLegalQ1"
"EndOfLifeQ1"
)

queries="${GUAC_DIR}/demo/graphql/queries.gql"
Expand Down
72 changes: 72 additions & 0 deletions internal/testing/e2e/expectEndOfLifeQ1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"HasMetadata": [
{
"subject": {
"type": "deb",
"namespaces": [
{
"namespace": "debian",
"names": [
{
"name": "openssl",
"versions": [
{
"purl": "pkg:deb/debian/openssl@1.1.1n-0%2Bdeb11u3?arch=amd64&distro=debian-11",
"version": "1.1.1n-0+deb11u3",
"qualifiers": [
{
"key": "arch",
"value": "amd64"
},
{
"key": "distro",
"value": "debian-11"
}
],
"subpath": ""
}
]
}
]
}
]
},
"key": "endoflife",
"value": "product:openssl,cycle:1.1.1,version:1.1.1n-0+deb11u3,isEOL:true,eolDate:2023-09-11,lts:true,latest:1.1.1w,releaseDate:2018-09-11"
},
{
"subject": {
"type": "deb",
"namespaces": [
{
"namespace": "debian",
"names": [
{
"name": "openssl",
"versions": [
{
"purl": "pkg:deb/debian/openssl@1.1.1n-0%2Bdeb11u3?arch=arm64&distro=debian-11",
"version": "1.1.1n-0+deb11u3",
"qualifiers": [
{
"key": "arch",
"value": "arm64"
},
{
"key": "distro",
"value": "debian-11"
}
],
"subpath": ""
}
]
}
]
}
]
},
"key": "endoflife",
"value": "product:openssl,cycle:1.1.1,version:1.1.1n-0+deb11u3,isEOL:true,eolDate:2023-09-11,lts:true,latest:1.1.1w,releaseDate:2018-09-11"
}
]
}

0 comments on commit 958be3f

Please sign in to comment.