diff --git a/csaf_2.1/prose/edit/src/tests-01-mndtr-14-sorted-revision-history.md b/csaf_2.1/prose/edit/src/tests-01-mndtr-14-sorted-revision-history.md index e0ed4185..784e406c 100644 --- a/csaf_2.1/prose/edit/src/tests-01-mndtr-14-sorted-revision-history.md +++ b/csaf_2.1/prose/edit/src/tests-01-mndtr-14-sorted-revision-history.md @@ -2,6 +2,7 @@ It MUST be tested that the value of `number` of items of the revision history are sorted ascending when the items are sorted ascending by `date` and as a second level criteria `number`. +As the timestamps might use different timezones, the sorting MUST take timezones into account. The relevant path for this test is: diff --git a/csaf_2.1/prose/edit/src/tests-01-mndtr-16-latest-document-version.md b/csaf_2.1/prose/edit/src/tests-01-mndtr-16-latest-document-version.md index 0dd95d19..6d7f7408 100644 --- a/csaf_2.1/prose/edit/src/tests-01-mndtr-16-latest-document-version.md +++ b/csaf_2.1/prose/edit/src/tests-01-mndtr-16-latest-document-version.md @@ -2,6 +2,7 @@ It MUST be tested that document version has the same value as the `number` in the last item of the revision history when it is sorted ascending by `date` and as a second level criteria `number`. +As the timestamps might use different timezones, the sorting MUST take timezones into account. Build metadata is ignored in the comparison. Any pre-release part is also ignored if the document status is `draft`. diff --git a/csaf_2.1/prose/edit/src/tests-01-mndtr-21-missing-item-in-revision-history.md b/csaf_2.1/prose/edit/src/tests-01-mndtr-21-missing-item-in-revision-history.md index cb0c9ac6..80168ceb 100644 --- a/csaf_2.1/prose/edit/src/tests-01-mndtr-21-missing-item-in-revision-history.md +++ b/csaf_2.1/prose/edit/src/tests-01-mndtr-21-missing-item-in-revision-history.md @@ -1,6 +1,7 @@ ### Missing Item in Revision History It MUST be tested that items of the revision history do not omit a version number when the items are sorted ascending by `date`. +As the timestamps might use different timezones, the sorting MUST take timezones into account. In the case of semantic versioning, this applies only to the Major version. It MUST also be tested that the first item in such a sorted list has either the version number 0 or 1 in the case of integer versioning or a Major version of 0 or 1 in the case of semantic versioning. diff --git a/csaf_2.1/prose/edit/src/tests-02-optional.md b/csaf_2.1/prose/edit/src/tests-02-optional.md index 08f04089..c726bb86 100644 --- a/csaf_2.1/prose/edit/src/tests-02-optional.md +++ b/csaf_2.1/prose/edit/src/tests-02-optional.md @@ -140,6 +140,7 @@ The relevant path for this test is: ### Older Initial Release Date than Revision History It MUST be tested that the Initial Release Date is not older than the `date` of the oldest item in Revision History. +As the timestamps might use different timezones, the sorting and comparison MUST take timezones into account. The relevant path for this test is: @@ -175,6 +176,7 @@ The relevant path for this test is: ### Older Current Release Date than Revision History It MUST be tested that the Current Release Date is not older than the `date` of the newest item in Revision History. +As the timestamps might use different timezones, the sorting and comparison MUST take timezones into account. The relevant path for this test is: diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json new file mode 100644 index 00000000..190ff247 --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json @@ -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": "Mandatory test: Sorted Revision History (failing example 9)", + "tracking": { + "current_release_date": "2024-01-22T22:45:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-14-09", + "initial_release_date": "2024-01-22T22:00:00.000Z", + "revision_history": [ + { + "date": "2024-01-23T10:00:00.000-12:00", + "number": "2", + "summary": "Second version." + }, + { + "date": "2024-01-22T10:00:00.000+12:45", + "number": "1", + "summary": "Initial version." + } + ], + "status": "final", + "version": "1" + } + } +} diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json new file mode 100644 index 00000000..5f409106 --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json @@ -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": "Mandatory test: Sorted Revision History (valid example 10)", + "tracking": { + "current_release_date": "2024-01-22T22:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-14-31", + "initial_release_date": "2024-01-22T22:45:00.000Z", + "revision_history": [ + { + "date": "2024-01-22T10:00:00.000+12:45", + "number": "2", + "summary": "Second version." + }, + { + "date": "2024-01-23T10:00:00.000-12:00", + "number": "1", + "summary": "Initial version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json new file mode 100644 index 00000000..ce49e6b5 --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json @@ -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": "Mandatory test: Latest Document Version (failing example 9)", + "tracking": { + "current_release_date": "2024-01-22T22:45:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-16-09", + "initial_release_date": "2024-01-22T22:00:00.000Z", + "revision_history": [ + { + "date": "2024-01-23T10:00:00.000-12:00", + "number": "2", + "summary": "Second version." + }, + { + "date": "2024-01-22T10:00:00.000+12:45", + "number": "1", + "summary": "Initial version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json new file mode 100644 index 00000000..70644e03 --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json @@ -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": "Mandatory test: Latest Document Version (valid example 11)", + "tracking": { + "current_release_date": "2024-01-22T22:45:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-16-32", + "initial_release_date": "2024-01-22T22:00:00.000Z", + "revision_history": [ + { + "date": "2024-01-22T10:00:00.000+12:45", + "number": "2", + "summary": "Second version." + }, + { + "date": "2024-01-23T10:00:00.000-12:00", + "number": "1", + "summary": "Initial version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json new file mode 100644 index 00000000..8c43c1c3 --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json @@ -0,0 +1,41 @@ +{ + "document": { + "category": "csaf_base", + "csaf_version": "2.1", + "distribution": { + "tlp": { + "label": "CLEAR" + } + }, + "publisher": { + "category": "other", + "name": "OASIS CSAF TC", + "namespace": "https://csaf.io" + }, + "title": "Mandatory test: Missing Item in Revision History (failing example 3)", + "tracking": { + "current_release_date": "2024-01-21T10:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-21-03", + "initial_release_date": "2023-08-22T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-08-22T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T10:00:00.000Z", + "number": "4", + "summary": "Some other changes." + }, + { + "date": "2024-01-21T11:00:00.000+03:00", + "number": "3", + "summary": "Some other changes." + } + ], + "status": "final", + "version": "4" + } + } +} diff --git a/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json new file mode 100644 index 00000000..92a9d6bb --- /dev/null +++ b/csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json @@ -0,0 +1,46 @@ +{ + "document": { + "category": "csaf_base", + "csaf_version": "2.1", + "distribution": { + "tlp": { + "label": "CLEAR" + } + }, + "publisher": { + "category": "other", + "name": "OASIS CSAF TC", + "namespace": "https://csaf.io" + }, + "title": "Mandatory test: Missing Item in Revision History (valid example 4)", + "tracking": { + "current_release_date": "2024-01-21T14:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-21-14", + "initial_release_date": "2023-08-22T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-08-22T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T10:00:00.000Z", + "number": "3", + "summary": "Some other changes." + }, + { + "date": "2024-01-21T11:00:00.000+03:00", + "number": "2", + "summary": "Some other changes." + }, + { + "date": "2024-01-21T09:00:00.000-05:00", + "number": "4", + "summary": "Some other changes." + } + ], + "status": "final", + "version": "4" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json new file mode 100644 index 00000000..15e44dec --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json @@ -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: Older Initial Release Date than Revision History (failing example 2)", + "tracking": { + "current_release_date": "2024-01-21T10:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-02", + "initial_release_date": "2023-09-06T10:00:00.000+10:00", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000-01:00", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000Z", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json new file mode 100644 index 00000000..569e4464 --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json @@ -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: Older Initial Release Date than Revision History (valid example 1)", + "tracking": { + "current_release_date": "2024-01-21T10:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-11", + "initial_release_date": "2023-09-06T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000Z", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json new file mode 100644 index 00000000..4c2b018a --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json @@ -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: Older Initial Release Date than Revision History (valid example 2)", + "tracking": { + "current_release_date": "2024-01-21T10:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-12", + "initial_release_date": "2023-09-06T10:00:00.000+10:00", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000+10:00", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000Z", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json new file mode 100644 index 00000000..a5037dcd --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json @@ -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: Older Current Release Date than Revision History (failing example 2)", + "tracking": { + "current_release_date": "2024-01-21T11:00:00.000-01:00", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-06-02", + "initial_release_date": "2023-09-06T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000+10:00", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json new file mode 100644 index 00000000..78bc07e0 --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json @@ -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: Older Current Release Date than Revision History (valid example 1)", + "tracking": { + "current_release_date": "2024-01-21T11:00:00.000Z", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-06-11", + "initial_release_date": "2023-09-06T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000Z", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json new file mode 100644 index 00000000..42c1f320 --- /dev/null +++ b/csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json @@ -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: Older Current Release Date than Revision History (valid example 2)", + "tracking": { + "current_release_date": "2024-01-21T11:00:00.000+10:00", + "id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-06-12", + "initial_release_date": "2023-09-06T10:00:00.000Z", + "revision_history": [ + { + "date": "2023-09-06T10:00:00.000Z", + "number": "1", + "summary": "Initial version." + }, + { + "date": "2024-01-21T11:00:00.000+10:00", + "number": "2", + "summary": "Second version." + } + ], + "status": "final", + "version": "2" + } + } +} diff --git a/csaf_2.1/test/validator/data/testcases.json b/csaf_2.1/test/validator/data/testcases.json index 6924b4b6..4f116445 100644 --- a/csaf_2.1/test/validator/data/testcases.json +++ b/csaf_2.1/test/validator/data/testcases.json @@ -349,6 +349,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-08.json", "valid": false + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json", + "valid": false } ], "valid": [ @@ -387,6 +391,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-19.json", "valid": true + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json", + "valid": true } ] }, @@ -449,6 +457,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-08.json", "valid": false + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json", + "valid": false } ], "valid": [ @@ -491,6 +503,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-31.json", "valid": true + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json", + "valid": true } ] }, @@ -549,6 +565,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-02.json", "valid": false + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json", + "valid": false } ], "valid": [ @@ -563,6 +583,10 @@ { "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-13.json", "valid": true + }, + { + "name": "mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json", + "valid": true } ] }, @@ -975,6 +999,20 @@ { "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-01.json", "valid": true + }, + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json", + "valid": true + } + ], + "valid": [ + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json", + "valid": true + }, + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json", + "valid": true } ] }, @@ -985,6 +1023,20 @@ { "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-01.json", "valid": true + }, + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json", + "valid": true + } + ], + "valid": [ + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json", + "valid": true + }, + { + "name": "optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json", + "valid": true } ] },