Skip to content

Commit 3d28bf5

Browse files
authored
Reported detected license in system packages #478 (#483)
* Add tests for system package licenses #478 * Validate that things run OK and license are detected with a minimal alpine and debian docker image. * Also adapt existing tests to new results. * Bump SCTK to latest version 31 Reference: #478 Signed-off-by: Philippe Ombredanne <[email protected]> * Sort expected test results #478 This minimizes changes in diffs Signed-off-by: Philippe Ombredanne <[email protected]> * Bump ScanCode toolkit to 31.0.0rc5 * also adjust tests accordingly Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 97bb941 commit 3d28bf5

14 files changed

+3882
-183
lines changed

scanpipe/tests/data/alpine_3_15_4_scan_codebase.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"code_view_url": "",
118118
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=dfa1379357a321e638feef1cd8d55ab03d020f45",
119119
"copyright": "",
120-
"license_expression": "",
120+
"license_expression": "gpl-2.0",
121121
"declared_license": "GPL-2.0-only",
122122
"notice_text": "",
123123
"manifest_path": "",
@@ -186,7 +186,7 @@
186186
"code_view_url": "",
187187
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=aab68f8c9ab434a46710de8e12fb3206e2930a59",
188188
"copyright": "",
189-
"license_expression": "",
189+
"license_expression": "mit",
190190
"declared_license": "MIT",
191191
"notice_text": "",
192192
"manifest_path": "",
@@ -375,7 +375,7 @@
375375
"code_view_url": "",
376376
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=1ac3c1bb29eeff083c621cf6b27ad12ab93cb73a",
377377
"copyright": "",
378-
"license_expression": "",
378+
"license_expression": "gpl-2.0",
379379
"declared_license": "GPL-2.0-only",
380380
"notice_text": "",
381381
"manifest_path": "",
@@ -409,7 +409,7 @@
409409
"code_view_url": "",
410410
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=2745de7e1b09e663b477a8141b84f7d81a049963",
411411
"copyright": "",
412-
"license_expression": "",
412+
"license_expression": "gpl-2.0",
413413
"declared_license": "GPL-2.0-only",
414414
"notice_text": "",
415415
"manifest_path": "",
@@ -454,7 +454,7 @@
454454
"code_view_url": "",
455455
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=709b70bcb72738cfedc510bba08141b012038167",
456456
"copyright": "",
457-
"license_expression": "",
457+
"license_expression": "mpl-2.0 AND mit",
458458
"declared_license": "MPL-2.0 AND MIT",
459459
"notice_text": "",
460460
"manifest_path": "",
@@ -499,7 +499,7 @@
499499
"code_view_url": "",
500500
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=455e966899a9358fc94f5bce633afe8a1942095c",
501501
"copyright": "",
502-
"license_expression": "",
502+
"license_expression": "openssl-ssleay",
503503
"declared_license": "OpenSSL",
504504
"notice_text": "",
505505
"manifest_path": "",
@@ -568,7 +568,7 @@
568568
"code_view_url": "",
569569
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=60424133be2e79bbfeff3d58147a22886f817ce2",
570570
"copyright": "",
571-
"license_expression": "",
571+
"license_expression": "bsd-simplified AND bsd-new",
572572
"declared_license": "BSD-2-Clause AND BSD-3-Clause",
573573
"notice_text": "",
574574
"manifest_path": "",
@@ -602,7 +602,7 @@
602602
"code_view_url": "",
603603
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=91c7a9f3aa296b6d462c5634e7658ebdbff65bb9",
604604
"copyright": "",
605-
"license_expression": "",
605+
"license_expression": "isc AND (bsd-new OR mit)",
606606
"declared_license": "ISC AND (BSD-3-Clause OR MIT)",
607607
"notice_text": "",
608608
"manifest_path": "",
@@ -647,7 +647,7 @@
647647
"code_view_url": "",
648648
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=455e966899a9358fc94f5bce633afe8a1942095c",
649649
"copyright": "",
650-
"license_expression": "",
650+
"license_expression": "openssl-ssleay",
651651
"declared_license": "OpenSSL",
652652
"notice_text": "",
653653
"manifest_path": "",
@@ -692,7 +692,7 @@
692692
"code_view_url": "",
693693
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=bf5bbfdbf780092f387b7abe401fbfceda90c84d",
694694
"copyright": "",
695-
"license_expression": "",
695+
"license_expression": "mit",
696696
"declared_license": "MIT",
697697
"notice_text": "",
698698
"manifest_path": "",
@@ -737,7 +737,7 @@
737737
"code_view_url": "",
738738
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=bf5bbfdbf780092f387b7abe401fbfceda90c84d",
739739
"copyright": "",
740-
"license_expression": "",
740+
"license_expression": "mit AND bsd-new AND gpl-2.0-plus",
741741
"declared_license": "MIT BSD GPL2+",
742742
"notice_text": "",
743743
"manifest_path": "",
@@ -771,7 +771,7 @@
771771
"code_view_url": "",
772772
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=86b3d4fbb0a760febf3476f9a58abf8d0f728d5c",
773773
"copyright": "",
774-
"license_expression": "",
774+
"license_expression": "gpl-2.0",
775775
"declared_license": "GPL-2.0-only",
776776
"notice_text": "",
777777
"manifest_path": "",
@@ -805,7 +805,7 @@
805805
"code_view_url": "",
806806
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=2745de7e1b09e663b477a8141b84f7d81a049963",
807807
"copyright": "",
808-
"license_expression": "",
808+
"license_expression": "gpl-2.0",
809809
"declared_license": "GPL-2.0-only",
810810
"notice_text": "",
811811
"manifest_path": "",
@@ -839,7 +839,7 @@
839839
"code_view_url": "",
840840
"vcs_url": "git+http://git.alpinelinux.org/aports/commit/?id=74148808679f47ad96dc99e83ef73acfdeec1642",
841841
"copyright": "",
842-
"license_expression": "",
842+
"license_expression": "zlib",
843843
"declared_license": "Zlib",
844844
"notice_text": "",
845845
"manifest_path": "",
@@ -1643,7 +1643,7 @@
16431643
"for_packages": [
16441644
"pkg:alpine/[email protected]?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
16451645
],
1646-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/color_prompt.sh.disabled",
1646+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/README",
16471647
"sha1": "",
16481648
"md5": "",
16491649
"extra_data": {},
@@ -1657,8 +1657,8 @@
16571657
"status": "system-package",
16581658
"tag": "img-06c7c4-layer-01-40e48c",
16591659
"type": "file",
1660-
"name": "color_prompt.sh",
1661-
"extension": ".disabled",
1660+
"name": "README",
1661+
"extension": "",
16621662
"programming_language": "",
16631663
"mime_type": "inode/x-empty",
16641664
"is_binary": false,
@@ -1671,7 +1671,7 @@
16711671
"for_packages": [
16721672
"pkg:alpine/[email protected]?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
16731673
],
1674-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/locale.sh",
1674+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/color_prompt.sh.disabled",
16751675
"sha1": "",
16761676
"md5": "",
16771677
"extra_data": {},
@@ -1685,9 +1685,9 @@
16851685
"status": "system-package",
16861686
"tag": "img-06c7c4-layer-01-40e48c",
16871687
"type": "file",
1688-
"name": "locale",
1689-
"extension": ".sh",
1690-
"programming_language": "Bash",
1688+
"name": "color_prompt.sh",
1689+
"extension": ".disabled",
1690+
"programming_language": "",
16911691
"mime_type": "inode/x-empty",
16921692
"is_binary": false,
16931693
"is_text": true,
@@ -1699,7 +1699,7 @@
16991699
"for_packages": [
17001700
"pkg:alpine/[email protected]?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
17011701
],
1702-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/README",
1702+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/profile.d/locale.sh",
17031703
"sha1": "",
17041704
"md5": "",
17051705
"extra_data": {},
@@ -1713,9 +1713,9 @@
17131713
"status": "system-package",
17141714
"tag": "img-06c7c4-layer-01-40e48c",
17151715
"type": "file",
1716-
"name": "README",
1717-
"extension": "",
1718-
"programming_language": "",
1716+
"name": "locale",
1717+
"extension": ".sh",
1718+
"programming_language": "Bash",
17191719
"mime_type": "inode/x-empty",
17201720
"is_binary": false,
17211721
"is_text": true,
@@ -1865,9 +1865,9 @@
18651865
},
18661866
{
18671867
"for_packages": [
1868-
"pkg:alpine/[email protected]-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
1868+
"pkg:alpine/ca-certificates-bundle@20211220-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
18691869
],
1870-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/ct_log_list.cnf.dist",
1870+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl/certs/ca-certificates.crt",
18711871
"sha1": "",
18721872
"md5": "",
18731873
"extra_data": {},
@@ -1881,8 +1881,8 @@
18811881
"status": "system-package",
18821882
"tag": "img-06c7c4-layer-01-40e48c",
18831883
"type": "file",
1884-
"name": "ct_log_list.cnf",
1885-
"extension": ".dist",
1884+
"name": "ca-certificates",
1885+
"extension": ".crt",
18861886
"programming_language": "",
18871887
"mime_type": "inode/x-empty",
18881888
"is_binary": false,
@@ -1895,7 +1895,7 @@
18951895
"for_packages": [
18961896
"pkg:alpine/[email protected]?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
18971897
],
1898-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/openssl.cnf",
1898+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/ct_log_list.cnf.dist",
18991899
"sha1": "",
19001900
"md5": "",
19011901
"extra_data": {},
@@ -1909,8 +1909,8 @@
19091909
"status": "system-package",
19101910
"tag": "img-06c7c4-layer-01-40e48c",
19111911
"type": "file",
1912-
"name": "openssl",
1913-
"extension": ".cnf",
1912+
"name": "ct_log_list.cnf",
1913+
"extension": ".dist",
19141914
"programming_language": "",
19151915
"mime_type": "inode/x-empty",
19161916
"is_binary": false,
@@ -1923,7 +1923,7 @@
19231923
"for_packages": [
19241924
"pkg:alpine/[email protected]?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
19251925
],
1926-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/openssl.cnf.dist",
1926+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/openssl.cnf",
19271927
"sha1": "",
19281928
"md5": "",
19291929
"extra_data": {},
@@ -1937,8 +1937,8 @@
19371937
"status": "system-package",
19381938
"tag": "img-06c7c4-layer-01-40e48c",
19391939
"type": "file",
1940-
"name": "openssl.cnf",
1941-
"extension": ".dist",
1940+
"name": "openssl",
1941+
"extension": ".cnf",
19421942
"programming_language": "",
19431943
"mime_type": "inode/x-empty",
19441944
"is_binary": false,
@@ -1949,9 +1949,9 @@
19491949
},
19501950
{
19511951
"for_packages": [
1952-
"pkg:alpine/ca-certificates-bundle@20211220-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
1952+
"pkg:alpine/[email protected]-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758"
19531953
],
1954-
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl/certs/ca-certificates.crt",
1954+
"path": "alpine_3_15_4.tar.gz-extract/40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/etc/ssl1.1/openssl.cnf.dist",
19551955
"sha1": "",
19561956
"md5": "",
19571957
"extra_data": {},
@@ -1965,8 +1965,8 @@
19651965
"status": "system-package",
19661966
"tag": "img-06c7c4-layer-01-40e48c",
19671967
"type": "file",
1968-
"name": "ca-certificates",
1969-
"extension": ".crt",
1968+
"name": "openssl.cnf",
1969+
"extension": ".dist",
19701970
"programming_language": "",
19711971
"mime_type": "inode/x-empty",
19721972
"is_binary": false,

scanpipe/tests/data/basic-rootfs_root_filesystems.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
"bug_tracking_url": "",
9999
"code_view_url": "",
100100
"vcs_url": "",
101-
"copyright": "",
102-
"license_expression": "",
101+
"copyright": "Copyright (c) 1998-2016 Free Software Foundation, Inc.\nCopyright (c) 2001 by Pradeep Padala\nCopyright (c) 1994 X Consortium\nCopyright (c) 1980, 1991, 1992, 1993 The Regents of the University of California\nCopyright 1996-2007 by Thomas E. Dickey",
102+
"license_expression": "x11-fsf AND x11-xconsortium AND bsd-new AND x11-fsf",
103103
"declared_license": "",
104104
"notice_text": "",
105105
"manifest_path": "",
@@ -170,9 +170,9 @@
170170
"bug_tracking_url": "",
171171
"code_view_url": "",
172172
"vcs_url": "",
173-
"copyright": "",
174-
"license_expression": "",
175-
"declared_license": "",
173+
"copyright": "Copyright 2013 Jiri Pirko <[email protected]>\nCopyright 2014 Andrew Ayer <[email protected]>",
174+
"license_expression": "(lgpl-2.1-plus AND lgpl-2.1-plus AND lgpl-2.1) AND (lgpl-2.1-plus AND lgpl-2.1-plus AND lgpl-2.1)",
175+
"declared_license": "['LGPL-2.1+', 'LGPL-2.1+', 'LGPL-2.1+']",
176176
"notice_text": "",
177177
"manifest_path": "",
178178
"contains_source_code": null,

scanpipe/tests/data/debian_scan_codebase.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
"bug_tracking_url": "",
117117
"code_view_url": "",
118118
"vcs_url": "",
119-
"copyright": "",
120-
"license_expression": "",
119+
"copyright": "Copyright (c) 1998-2016 Free Software Foundation, Inc.\nCopyright (c) 2001 by Pradeep Padala\nCopyright (c) 1994 X Consortium\nCopyright (c) 1980, 1991, 1992, 1993 The Regents of the University of California\nCopyright 1996-2007 by Thomas E. Dickey",
120+
"license_expression": "x11-fsf AND x11-xconsortium AND bsd-new AND x11-fsf",
121121
"declared_license": "",
122122
"notice_text": "",
123123
"manifest_path": "",
@@ -188,9 +188,9 @@
188188
"bug_tracking_url": "",
189189
"code_view_url": "",
190190
"vcs_url": "",
191-
"copyright": "",
192-
"license_expression": "",
193-
"declared_license": "",
191+
"copyright": "Copyright 2013 Jiri Pirko <[email protected]>\nCopyright 2014 Andrew Ayer <[email protected]>",
192+
"license_expression": "(lgpl-2.1-plus AND lgpl-2.1-plus AND lgpl-2.1) AND (lgpl-2.1-plus AND lgpl-2.1-plus AND lgpl-2.1)",
193+
"declared_license": "['LGPL-2.1+', 'LGPL-2.1+', 'LGPL-2.1+']",
194194
"notice_text": "",
195195
"manifest_path": "",
196196
"contains_source_code": null,
Binary file not shown.

0 commit comments

Comments
 (0)