Skip to content

Commit

Permalink
Merge pull request #744 from tschmidtb51/same-timestamps
Browse files Browse the repository at this point in the history
Optional Test: Same Timestamps in Revision History
  • Loading branch information
tschmidtb51 authored Jun 17, 2024
2 parents 40a2236 + e7cdef3 commit 1f005f2
Show file tree
Hide file tree
Showing 11 changed files with 469 additions and 1 deletion.
30 changes: 30 additions & 0 deletions csaf_2.1/prose/edit/src/tests-02-optional.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,33 @@ The relevant path for this test is:
> The key `custom_property` is not defined in the JSON schema.
> A tool MAY remove such keys as a quick fix.
### Same Timestamps in Revision History

It MUST be tested that the timestamps of all items in the revision history are pairwise disjoint.
As the timestamps might use different timezones, the comparison MUST take timezones into account.

The relevant path for this test is:

```
/document/tracking/revision_history[]/date
```

*Example 1 (which fails the test):*

```
"revision_history": [
{
"date": "2024-01-21T10:00:00.000Z",
"number": "2.0.0",
"summary": "Second version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1.0.0",
"summary": "Initial version."
}
]
```

> The first and second revision have the same timestamp.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (failing example 1)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-01",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.000Z",
"number": "2.0.0",
"summary": "Second version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1.0.0",
"summary": "Initial version."
}
],
"status": "final",
"version": "2.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (failing example 2)",
"tracking": {
"current_release_date": "2024-01-23T13:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-02",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.000Z",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-22T11:00:00.000Z",
"number": "4",
"summary": "Fourth version."
},
{
"date": "2024-01-23T12:00:00.000Z",
"number": "5",
"summary": "Fifth version."
},
{
"date": "2024-01-22T11:00:00.000Z",
"number": "3",
"summary": "Third version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-22T11:00:00.000Z",
"number": "6",
"summary": "Sixth version."
},
{
"date": "2024-01-23T13:00:00.000Z",
"number": "7",
"summary": "Seventh version."
}
],
"status": "final",
"version": "7"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (failing example 3)",
"tracking": {
"current_release_date": "2024-01-22T00:00:00.000+14:00",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-03",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T11:00:00.000+01:00",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-21T20:00:00.000+10:00",
"number": "3",
"summary": "Third version."
},
{
"date": "2024-01-21T05:00:00.000-05:00",
"number": "4",
"summary": "Fourth version."
},
{
"date": "2024-01-21T13:00:00.000+03:00",
"number": "5",
"summary": "Fifth version."
},
{
"date": "2024-01-21T07:00:00.000-03:00",
"number": "6",
"summary": "Sixth version."
},
{
"date": "2024-01-21T00:00:00.000-10:00",
"number": "7",
"summary": "Seventh version."
},
{
"date": "2024-01-22T00:00:00.000+14:00",
"number": "8",
"summary": "Eighth version."
}
],
"status": "final",
"version": "8"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (failing example 4)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-04",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.000000Z",
"number": "2.0.0",
"summary": "Second version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1.0.0",
"summary": "Initial version."
}
],
"status": "final",
"version": "2.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (failing example 5)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-05",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.000+00:00",
"number": "2.0.0",
"summary": "Second version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1.0.0",
"summary": "Initial version."
}
],
"status": "final",
"version": "2.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (valid example 1)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.0001Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-11",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.0001Z",
"number": "2.0.0",
"summary": "Second version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "1.0.0",
"summary": "Initial version."
}
],
"status": "final",
"version": "2.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Same Timestamps in Revision History (valid example 2)",
"tracking": {
"current_release_date": "2024-01-23T13:55:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-21-12",
"initial_release_date": "2024-01-21T10:00:00.000Z",
"revision_history": [
{
"date": "2024-01-21T10:00:00.0005Z",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-22T12:00:00.000Z",
"number": "4",
"summary": "Fourth version."
},
{
"date": "2024-01-23T12:00:00.000Z",
"number": "5",
"summary": "Fifth version."
},
{
"date": "2024-01-22T11:00:00.000Z",
"number": "3",
"summary": "Third version."
},
{
"date": "2024-01-21T10:00:00.0002Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-23T13:00:00.000Z",
"number": "6",
"summary": "Sixth version."
},
{
"date": "2024-01-23T13:55:00.000Z",
"number": "7",
"summary": "Seventh version."
}
],
"status": "final",
"version": "7"
}
}
}
Loading

0 comments on commit 1f005f2

Please sign in to comment.