Skip to content
Open
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
*.swp
tests/
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
language: python

before_install:
- git clone https://github.com/STIXProject/schemas-test.git tests

install:
- sudo apt-get update
- sudo apt-get install libxml2-dev libxslt-dev zlib1g-dev
- pip install -q stix-validator

# checks against the latest commit to master of schema (may be ahead of official release)
# manifest = a list of testfiles to run, i.e. `ls -1 $test_dir [...] >> manifest.cfg`
script: python test_runner.py --test-case-repository tests test_manifest.cfg
script: python tests/test_runner.py --test-case-repository tests

branches:
only:
Expand Down
4,845 changes: 0 additions & 4,845 deletions test_manifest.cfg

This file was deleted.

156 changes: 0 additions & 156 deletions test_runner.py

This file was deleted.

29 changes: 29 additions & 0 deletions tests/issues/134_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
test case for https://github.com/STIXProject/schemas/issues/134
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:indicator="http://stix.mitre.org/Indicator-2"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:genericTM="http://stix.mitre.org/extensions/TestMechanism#Generic-1"
xmlns:example="http://example.com/"



id="example:STIXPackage-0935d61b-69a4-4e64-8c4c-d9ce885f7fcc"
timestamp="2014-05-08T09:00:00.000000Z"
version="1.1.1"
>
<stix:Indicators>
<stix:Indicator xsi:type="indicator:IndicatorType" >

<indicator:Test_Mechanisms>
<indicator:Test_Mechanism id="example:TestMechanism-5f5fde43-ee30-4582-afaa-238a672f70b1"
xsi:type="genericTM:GenericTestMechanismType">
<!-- leaving Desc, Spec, and Type out to test that it still validates -->
</indicator:Test_Mechanism>
</indicator:Test_Mechanisms>
</stix:Indicator>
</stix:Indicators>
</stix:STIX_Package>
47 changes: 47 additions & 0 deletions tests/issues/135_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
test case for https://github.com/STIXProject/schemas/issues/135
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:stixCommon="http://stix.mitre.org/common-1"
xmlns:et="http://stix.mitre.org/ExploitTarget-1"
xmlns:stix-cvrf="http://stix.mitre.org/extensions/Vulnerability#CVRF-1"
xmlns:cvrf="http://www.icasi.org/CVRF/schema/cvrf/1.1"
xmlns:example="http://example.com/"
version="1.2">

<stix:Exploit_Targets>
<stixCommon:Exploit_Target xsi:type="et:ExploitTargetType">
<et:Title>Test CVRF Extension</et:Title>
<et:Vulnerability xsi:type="stix-cvrf:CVRF1.1InstanceType">
<et:Title>Test</et:Title>
<cvrfdoc xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1">
<DocumentTitle>Test</DocumentTitle>
<DocumentType>Test</DocumentType>
<DocumentPublisher Type="Vendor" VendorID="000">
<ContactDetails>Test</ContactDetails>
<IssuingAuthority>Test</IssuingAuthority>
</DocumentPublisher>
<DocumentTracking>
<Identification>
<ID>test</ID>
</Identification>
<Status>Final</Status>
<Version>1.0</Version>
<RevisionHistory>
<Revision>
<Number>1.0</Number>
<Date>2015-05-15T00:00:00+00:00</Date>
<Description>Test.</Description>
</Revision>
</RevisionHistory>
<InitialReleaseDate>2015-05-15T00:00:00+00:00</InitialReleaseDate>
<CurrentReleaseDate>2015-05-15T00:00:00+00:00</CurrentReleaseDate>
</DocumentTracking>
</cvrfdoc>
</et:Vulnerability>
</stixCommon:Exploit_Target>
</stix:Exploit_Targets>

</stix:STIX_Package>
24 changes: 24 additions & 0 deletions tests/issues/138_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
test case for https://github.com/STIXProject/schemas/issues/138
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:indicator="http://stix.mitre.org/Indicator-2"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:example="http://example.com/"
xmlns:stixCommon="http://stix.mitre.org/common-1"

id="example:STIXPackage-0935d61b-69a4-4e64-8c4c-d9ce885f7fcc"
timestamp="2014-05-08T09:00:00.000000Z"
version="1.1.1"
>
<stix:Indicators>
<stix:Indicator xsi:type="indicator:IndicatorType" >
<indicator:Sightings><indicator:Sighting><indicator:Source>
<stixCommon:Description>"test case"</stixCommon:Description>
<stixCommon:Identity><stixCommon:Name>Jimbob Jones</stixCommon:Name></stixCommon:Identity>
</indicator:Source></indicator:Sighting></indicator:Sightings>
</stix:Indicator>
</stix:Indicators>
</stix:STIX_Package>
34 changes: 34 additions & 0 deletions tests/issues/152_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
test case for https://github.com/ST
IXProject/schemas/issues/152
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:indicator="http://stix.mitre.org/Indicator-2"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:example="http://example.com/"
xmlns:stixCommon="http://stix.mitre.org/common-1"

id="example:STIXPackage-0935d61b-69a4-4e64-8c4c-d9ce885f7fcc"
timestamp="2014-05-08T09:00:00.000000Z"
version="1.1.1"
>
<stix:Indicators>
<stix:Indicator xsi:type="indicator:IndicatorType" >
<indicator:Related_Campaigns>

<indicator:Related_Campaign>
<stixCommon:Confidence><stixCommon:Value>50</stixCommon:Value></stixCommon:Confidence>
<stixCommon:Information_Source><stixCommon:Description>"Internal security team"</stixCommon:Description>
<stixCommon:Identity><stixCommon:Name>MITRE Infosec</stixCommon:Name></stixCommon:Identity>
</stixCommon:Information_Source>
<stixCommon:Relationship>"connected to"</stixCommon:Relationship>
<stixCommon:Campaign><stixCommon:Names>
<stixCommon:Name>"Comment Crew"</stixCommon:Name>
</stixCommon:Names></stixCommon:Campaign>
</indicator:Related_Campaign>
</indicator:Related_Campaigns>
</stix:Indicator>
</stix:Indicators>
</stix:STIX_Package>
32 changes: 32 additions & 0 deletions tests/issues/153_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
test case for https://github.com/STIXProject/schemas/issues/153
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:incident="http://stix.mitre.org/Incident-1"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:example="http://example.com/"
xmlns:stixCommon="http://stix.mitre.org/common-1"

id="example:STIXPackage-0935d61b-69a4-4e64-8c4c-d9ce885f7fcc"
timestamp="2014-05-08T09:00:00.000000Z"
version="1.1.1"
>

<!-- show that vocab is enforced on the type of availability lost-->
<stix:Incidents>
<stix:Incident xsi:type="incident:IncidentType" >
<incident:Affected_Assets xsi:type="incident:AffectedAssetsType">
<incident:Affected_Asset>
<incident:Nature_Of_Security_Effect>
<incident:Property_Affected>
<incident:Type_Of_Availability_Loss xsi:type="stixVocabs:AvailabilityLossTypeVocab-1.1.1">Degradation</incident:Type_Of_Availability_Loss>
</incident:Property_Affected>
</incident:Nature_Of_Security_Effect>
</incident:Affected_Asset>
</incident:Affected_Assets>
</stix:Incident>
</stix:Incidents>

</stix:STIX_Package>
29 changes: 29 additions & 0 deletions tests/issues/157_case.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
test case for https://github.com/STIXProject/schemas/issues/157
-->
<stix:STIX_Package
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:indicator="http://stix.mitre.org/Indicator-2"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:example="http://example.com/"
xmlns:stixCommon="http://stix.mitre.org/common-1"

id="example:STIXPackage-0935d61b-69a4-4e64-8c4c-d9ce885f7fcc"
timestamp="2014-05-08T09:00:00.000000Z"
version="1.1.1"
>
<stix:Indicators>
<stix:Indicator xsi:type="indicator:IndicatorType" >
<!-- show that confidence is of type InformationSource, and contains Identity -->
<indicator:Confidence> <stixCommon:Confidence_Assertion_Chain>
<stixCommon:Confidence_Assertion>
<stixCommon:Source>
<stixCommon:Identity>
<stixCommon:Name>Secret Squirrels</stixCommon:Name>
</stixCommon:Identity></stixCommon:Source></stixCommon:Confidence_Assertion>
</stixCommon:Confidence_Assertion_Chain></indicator:Confidence>

</stix:Indicator>
</stix:Indicators>
</stix:STIX_Package>
Loading