Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 11 additions & 52 deletions tests/Makefile
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,22 +15,14 @@ SHELL := /bin/bash

top_srcdir := $(shell cd .. ; pwd)

srcdir := $(shell pwd)

PYTHON3 ?= $(shell which python3.9 2>/dev/null || which python3.8 2>/dev/null || which python3.7 2>/dev/null || which python3.6 2>/dev/null || which python3)

all: \
all-case_file \
all-case_sparql_construct \
all-case_sparql_select
all-case_utils

.PHONY: \
all-case_file \
all-case_sparql_construct \
all-case_sparql_select \
check-case_file \
check-case_sparql_construct \
check-case_sparql_select \
all-case_utils \
check-case_utils \
check-isomorphic_diff \
check-mypy \
download
Expand DownExpand Up@@ -60,51 +52,26 @@ all: \
.
touch $@

all-case_file: \
.venv.done.log
$(MAKE) \
--directory case_file

all-case_sparql_construct: \
.venv.done.log
$(MAKE) \
--directory case_sparql_construct

all-case_sparql_select: \
all-case_utils: \
.venv.done.log
$(MAKE) \
--directory case_sparql_select
--directory case_utils

# These check calls are provided in preferred run-order.
check: \
check-isomorphic_diff \
check-mypy \
check-case_file \
check-case_sparql_construct \
check-case_sparql_select
check-isomorphic_diff \
check-case_utils
source venv/bin/activate \
&& pytest \
--ignore case_file \
--ignore case_sparql_construct \
--ignore case_sparql_select \
--ignore case_utils \
--log-level=DEBUG

check-case_file: \
.venv.done.log
$(MAKE) \
--directory case_file \
check

check-case_sparql_construct: \
.venv.done.log
$(MAKE) \
--directory case_sparql_construct \
check

check-case_sparql_select: \
check-case_utils: \
.venv.done.log
$(MAKE) \
--directory case_sparql_select \
--directory case_utils \
check

check-isomorphic_diff: \
Expand All@@ -119,21 +86,13 @@ check-mypy: \
source venv/bin/activate \
&& mypy \
$(top_srcdir)/case_utils \
case_file \
case_sparql_construct \
case_utils \
hexbinary \
src

clean:
@$(MAKE) \
--directory case_sparql_select \
clean
@$(MAKE) \
--directory case_sparql_construct \
clean
@$(MAKE) \
--directory case_file \
--directory case_utils \
clean
@rm -f \
.venv.done.log
Expand Down
86 changes: 86 additions & 0 deletions tests/case_utils/Makefile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
#!/usr/bin/make -f

# This software was developed at the National Institute of Standards
# and Technology by employees of the Federal Government in the course
# of their official duties. Pursuant to title 17 Section 105 of the
# United States Code this software is not subject to copyright
# protection and is in the public domain. NIST assumes no
# responsibility whatsoever for its use by other parties, and makes
# no guarantees, expressed or implied, about its quality,
# reliability, or any other characteristic.
#
# We would appreciate acknowledgement if the software is used.

SHELL := /bin/bash

top_srcdir := $(shell cd ../.. ; pwd)

tests_srcdir := $(top_srcdir)/tests

all: \
all-case_file \
all-case_sparql_construct \
all-case_sparql_select

.PHONY: \
all-case_file \
all-case_sparql_construct \
all-case_sparql_select \
check-case_file \
check-case_sparql_construct \
check-case_sparql_select

all-case_file: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_file

all-case_sparql_construct: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_sparql_construct

all-case_sparql_select: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_sparql_select

check: \
check-case_file \
check-case_sparql_construct \
check-case_sparql_select
source $(tests_srcdir)/venv/bin/activate \
&& pytest \
--ignore case_file \
--ignore case_sparql_construct \
--ignore case_sparql_select \
--log-level=DEBUG

check-case_file: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_file \
check

check-case_sparql_construct: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_sparql_construct \
check

check-case_sparql_select: \
$(tests_srcdir)/.venv.done.log
$(MAKE) \
--directory case_sparql_select \
check

clean:
@$(MAKE) \
--directory case_sparql_select \
clean
@$(MAKE) \
--directory case_sparql_construct \
clean
@$(MAKE) \
--directory case_file \
clean
File renamed without changes.
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@

SHELL := /bin/bash

top_srcdir := $(shell cd ../.. ; pwd)
top_srcdir := $(shell cd ../../.. ; pwd)

tests_srcdir := $(top_srcdir)/tests

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
},
"@graph": [
{
"@id": "kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d",
"@id": "kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c",
"@type": "uco-observable:ObservableObject",
"uco-core:hasFacet": {
"@type": "uco-observable:FileFacet",
Expand All@@ -25,7 +25,7 @@
}
},
{
"@id": "kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d",
"@id": "kb:file-9477a6eb-3a94-590b-b51e-6ce6892f0941",
"@type": "uco-observable:ObservableObject",
"uco-core:hasFacet": [
{
Expand Down
4 changes: 2 additions & 2 deletions tests/case_file/kb.ttl → tests/case_utils/case_file/kb.ttl
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
@prefix uco-vocabulary: <https://unifiedcyberontology.org/ontology/uco/vocabulary#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d
kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c
a uco-observable:ObservableObject ;
uco-core:hasFacet [
a uco-observable:FileFacet ;
Expand All@@ -18,7 +18,7 @@ kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d
] ;
.

kb:file-57400969-69d0-5d5d-95c4-9dd7de330d3d
kb:file-9477a6eb-3a94-590b-b51e-6ce6892f0941
a uco-observable:ObservableObject ;
uco-core:hasFacet
[
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
@prefix uco-observable: <https://unifiedcyberontology.org/ontology/uco/observable#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

kb:file-16d49634-ba5d-5f46-ab4e-7a577a4e096d
kb:file-69751792-9d04-5f5f-8791-99ca3729cd3c
a uco-observable:ObservableObject ;
uco-core:hasFacet [
a uco-observable:FileFacet ;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,93 +12,93 @@
},
"@graph": [
{
"@id": "http://example.org/kb/file-72a7af43-7798-5794-88fd-49c0d3c76ccb",
"@id": "http://example.org/kb/file-4216a9f3-45fc-55aa-8e48-a9f828173625",
"@type": "https://unifiedcyberontology.org/ontology/uco/observable#ObservableObject",
"https://unifiedcyberontology.org/ontology/uco/core#hasFacet": [
{
"@id": "_:N9465521b80bf49c586f914908dfc46a2"
"@id": "_:Ncbd74ec540fa42b09802cdf033ec0e86"
},
{
"@id": "_:Ne7887bd0a239424bb588bed06ec4fc77"
"@id": "_:N1b091168b6e746ca8ffef67ba546f52c"
}
]
},
{
"@id": "_:N9465521b80bf49c586f914908dfc46a2",
"@id": "_:Ncbd74ec540fa42b09802cdf033ec0e86",
"@type": "https://unifiedcyberontology.org/ontology/uco/observable#FileFacet",
"https://unifiedcyberontology.org/ontology/uco/observable#fileName": "sample.txt",
"https://unifiedcyberontology.org/ontology/uco/observable#modifiedTime": {
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
"@value": "2010-01-02T03:04:56+00:00"
},
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4
},
{
"@id": "_:N1b091168b6e746ca8ffef67ba546f52c",
"@type": "https://unifiedcyberontology.org/ontology/uco/observable#ContentDataFacet",
"https://unifiedcyberontology.org/ontology/uco/observable#hash": [
{
"@id": "_:Nad6171b4933a4a84b83faa5d48fd4ddb"
"@id": "_:Nf0f6ff73c49045ffa53e2fc83249d20b"
},
{
"@id": "_:N1ee7a053f4bd466e8fca1105b8392292"
"@id": "_:Na2470e1f29914026a1690b0e9386cc1f"
},
{
"@id": "_:N098fa95f7ef2409b864a9fb6b291ab08"
"@id": "_:Nd8473ff30e87456d8dcd034729ba27ed"
},
{
"@id": "_:Na99d1f2a83814ac491c9b02662ea8587"
"@id": "_:Ncaa10f1e5cf84d8286f1d1c536b9fa06"
}
],
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4
},
{
"@id": "_:Nad6171b4933a4a84b83faa5d48fd4ddb",
"@id": "_:Nf0f6ff73c49045ffa53e2fc83249d20b",
"@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash",
"https://unifiedcyberontology.org/ontology/uco/types#hashMethod": {
"@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab",
"@value": "SHA512"
"@value": "MD5"
},
"https://unifiedcyberontology.org/ontology/uco/types#hashValue": {
"@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
"@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
"@value": "098f6bcd4621d373cade4e832627b4f6"
}
},
{
"@id": "_:N1ee7a053f4bd466e8fca1105b8392292",
"@id": "_:Na2470e1f29914026a1690b0e9386cc1f",
"@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash",
"https://unifiedcyberontology.org/ontology/uco/types#hashMethod": {
"@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab",
"@value": "SHA256"
"@value": "SHA1"
},
"https://unifiedcyberontology.org/ontology/uco/types#hashValue": {
"@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
"@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
"@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
}
},
{
"@id": "_:N098fa95f7ef2409b864a9fb6b291ab08",
"@id": "_:Nd8473ff30e87456d8dcd034729ba27ed",
"@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash",
"https://unifiedcyberontology.org/ontology/uco/types#hashMethod": {
"@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab",
"@value": "SHA1"
"@value": "SHA256"
},
"https://unifiedcyberontology.org/ontology/uco/types#hashValue": {
"@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
"@value": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
"@value": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
},
{
"@id": "_:Na99d1f2a83814ac491c9b02662ea8587",
"@id": "_:Ncaa10f1e5cf84d8286f1d1c536b9fa06",
"@type": "https://unifiedcyberontology.org/ontology/uco/types#Hash",
"https://unifiedcyberontology.org/ontology/uco/types#hashMethod": {
"@type": "https://unifiedcyberontology.org/ontology/uco/vocabulary#HashNameVocab",
"@value": "MD5"
"@value": "SHA512"
},
"https://unifiedcyberontology.org/ontology/uco/types#hashValue": {
"@type": "http://www.w3.org/2001/XMLSchema#hexBinary",
"@value": "098f6bcd4621d373cade4e832627b4f6"
"@value": "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"
}
},
{
"@id": "_:Ne7887bd0a239424bb588bed06ec4fc77",
"@type": "https://unifiedcyberontology.org/ontology/uco/observable#FileFacet",
"https://unifiedcyberontology.org/ontology/uco/observable#fileName": "sample.txt",
"https://unifiedcyberontology.org/ontology/uco/observable#modifiedTime": {
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
"@value": "2010-01-02T03:04:56+00:00"
},
"https://unifiedcyberontology.org/ontology/uco/observable#sizeInBytes": 4
}
]
}
}
Loading