From 7158738673da1af6e6aa2a55f9a9f9c3fc2a1222 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Fri, 31 May 2024 19:22:22 +0200 Subject: [PATCH 1/5] Sort timestamps with timezones - addresses parts of oasis-tcs/csaf#749 - clarify that timestamps might have different timezones - add invalid example for 6.1.14 - add valid example for 6.1.14 --- ...sts-01-mndtr-14-sorted-revision-history.md | 1 + ...oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json | 36 +++++++++++++++++++ csaf_2.1/test/validator/data/testcases.json | 8 +++++ 4 files changed, 81 insertions(+) create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-09.json create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-14-31.json 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 e0ed41853..784e406cb 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/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 000000000..190ff2470 --- /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 000000000..5f4091069 --- /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/testcases.json b/csaf_2.1/test/validator/data/testcases.json index 6924b4b6e..2066cdaa3 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 } ] }, From e06ce18c73e25868c1bd8b8c5962ed04ef4ac360 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Fri, 31 May 2024 19:39:35 +0200 Subject: [PATCH 2/5] Sort timestamps with timezones - addresses parts of oasis-tcs/csaf#749 - clarify that timestamps might have different timezones - add invalid example for 6.1.16 - add valid example for 6.1.16 --- ...sts-01-mndtr-16-latest-document-version.md | 1 + ...oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json | 36 +++++++++++++++++++ csaf_2.1/test/validator/data/testcases.json | 8 +++++ 4 files changed, 81 insertions(+) create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-09.json create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-16-32.json 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 0dd95d191..6d7f74087 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/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 000000000..ce49e6b5e --- /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 000000000..70644e037 --- /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/testcases.json b/csaf_2.1/test/validator/data/testcases.json index 2066cdaa3..4316d6304 100644 --- a/csaf_2.1/test/validator/data/testcases.json +++ b/csaf_2.1/test/validator/data/testcases.json @@ -457,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": [ @@ -499,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 } ] }, From f3316877a5d23f83d639d731da1ed70be76432c1 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Fri, 31 May 2024 21:06:43 +0200 Subject: [PATCH 3/5] Sort timestamps with timezones - addresses parts of oasis-tcs/csaf#749 - clarify that timestamps might have different timezones - add invalid example for 6.1.21 - add valid example for 6.1.21 --- ...dtr-21-missing-item-in-revision-history.md | 1 + ...oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json | 41 +++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json | 46 +++++++++++++++++++ csaf_2.1/test/validator/data/testcases.json | 8 ++++ 4 files changed, 96 insertions(+) create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-03.json create mode 100644 csaf_2.1/test/validator/data/mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-21-14.json 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 cb0c9ac60..80168cebc 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/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 000000000..8c43c1c3f --- /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 000000000..92a9d6bba --- /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/testcases.json b/csaf_2.1/test/validator/data/testcases.json index 4316d6304..252a5b6a6 100644 --- a/csaf_2.1/test/validator/data/testcases.json +++ b/csaf_2.1/test/validator/data/testcases.json @@ -565,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": [ @@ -579,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 } ] }, From 9404cdae7ccad3e6873a91df6fde1464481ca461 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Fri, 31 May 2024 21:17:49 +0200 Subject: [PATCH 4/5] Sort timestamps with timezones - addresses parts of oasis-tcs/csaf#749, oasis-tcs/csaf#341 - clarify that timestamps might have different timezones - add invalid example for 6.2.5 - add valid examples for 6.2.5 --- csaf_2.1/prose/edit/src/tests-02-optional.md | 1 + ...oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json | 36 +++++++++++++++++++ csaf_2.1/test/validator/data/testcases.json | 14 ++++++++ 5 files changed, 123 insertions(+) create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-02.json create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-11.json create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-05-12.json 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 08f040893..8df0a5f82 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: 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 000000000..15e44dec2 --- /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 000000000..569e44646 --- /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 000000000..4c2b018a2 --- /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/testcases.json b/csaf_2.1/test/validator/data/testcases.json index 252a5b6a6..63e61f576 100644 --- a/csaf_2.1/test/validator/data/testcases.json +++ b/csaf_2.1/test/validator/data/testcases.json @@ -999,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 } ] }, From 6d7329e7924a1e615a82d3c6feba1a9984a94be0 Mon Sep 17 00:00:00 2001 From: tschmidtb51 <65305130+tschmidtb51@users.noreply.github.com> Date: Fri, 31 May 2024 21:24:18 +0200 Subject: [PATCH 5/5] Sort timestamps with timezones - addresses parts of oasis-tcs/csaf#749, oasis-tcs/csaf#341 - clarify that timestamps might have different timezones - add invalid example for 6.2.6 - add valid examples for 6.2.6 --- csaf_2.1/prose/edit/src/tests-02-optional.md | 1 + ...oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json | 36 +++++++++++++++++++ ...oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json | 36 +++++++++++++++++++ csaf_2.1/test/validator/data/testcases.json | 14 ++++++++ 5 files changed, 123 insertions(+) create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-02.json create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-11.json create mode 100644 csaf_2.1/test/validator/data/optional/oasis_csaf_tc-csaf_2_1-2024-6-2-06-12.json 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 8df0a5f82..c726bb86a 100644 --- a/csaf_2.1/prose/edit/src/tests-02-optional.md +++ b/csaf_2.1/prose/edit/src/tests-02-optional.md @@ -176,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/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 000000000..a5037dcd1 --- /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 000000000..78bc07e00 --- /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 000000000..42c1f320e --- /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 63e61f576..4f116445d 100644 --- a/csaf_2.1/test/validator/data/testcases.json +++ b/csaf_2.1/test/validator/data/testcases.json @@ -1023,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 } ] },