Change condition to match go/thirdpartylicenses

Policy uses restricted_if_statically_linked at
https://opensource.google/documentation/reference/thirdparty/licenses#RestrictedIfStaticallyLinked

Test: m droid
Change-Id: I9b18d3133ae72de1bede99f46b530298313bc2e6
This commit is contained in:
Bob Badour
2022-11-22 12:04:10 -08:00
parent dd026fce63
commit cac8a3cf09
14 changed files with 324 additions and 324 deletions

View File

@@ -341,13 +341,13 @@ func Test_plaintext(t *testing.T) {
roots: []string{"highest.apex.meta_lic"},
ctx: context{stripPrefix: []string{"testdata/restricted/"}, labelConditions: true},
expectedOut: []string{
"bin/bin1.meta_lic:notice lib/liba.so.meta_lic:restricted_allows_dynamic_linking static",
"bin/bin1.meta_lic:notice lib/liba.so.meta_lic:restricted_if_statically_linked static",
"bin/bin1.meta_lic:notice lib/libc.a.meta_lic:reciprocal static",
"bin/bin2.meta_lic:notice lib/libb.so.meta_lic:restricted dynamic",
"bin/bin2.meta_lic:notice lib/libd.so.meta_lic:notice dynamic",
"highest.apex.meta_lic:notice bin/bin1.meta_lic:notice static",
"highest.apex.meta_lic:notice bin/bin2.meta_lic:notice static",
"highest.apex.meta_lic:notice lib/liba.so.meta_lic:restricted_allows_dynamic_linking static",
"highest.apex.meta_lic:notice lib/liba.so.meta_lic:restricted_if_statically_linked static",
"highest.apex.meta_lic:notice lib/libb.so.meta_lic:restricted static",
},
},
@@ -1011,7 +1011,7 @@ func Test_graphviz(t *testing.T) {
matchTarget("bin/bin1.meta_lic", "notice"),
matchTarget("bin/bin2.meta_lic", "notice"),
matchTarget("highest.apex.meta_lic", "notice"),
matchTarget("lib/liba.so.meta_lic", "restricted_allows_dynamic_linking"),
matchTarget("lib/liba.so.meta_lic", "restricted_if_statically_linked"),
matchTarget("lib/libb.so.meta_lic", "restricted"),
matchTarget("lib/libc.a.meta_lic", "reciprocal"),
matchTarget("lib/libd.so.meta_lic", "notice"),

View File

@@ -529,18 +529,18 @@ func Test_plaintext(t *testing.T) {
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"testdata/restricted/bin/bin2.meta_lic testdata/restricted/bin/bin2.meta_lic notice:restricted",
"testdata/restricted/bin/bin2.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_if_statically_linked",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/bin/bin2.meta_lic notice:restricted",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/highest.apex.meta_lic notice:restricted:restricted_allows_dynamic_linking",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/highest.apex.meta_lic notice:restricted:restricted_if_statically_linked",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"testdata/restricted/lib/liba.so.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/highest.apex.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"testdata/restricted/lib/liba.so.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/lib/libb.so.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
},
},
@@ -550,18 +550,18 @@ func Test_plaintext(t *testing.T) {
roots: []string{"highest.apex.meta_lic"},
ctx: context{stripPrefix: []string{"testdata/restricted/"}},
expectedOut: []string{
"bin/bin1.meta_lic bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic bin/bin1.meta_lic notice:restricted_if_statically_linked",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"bin/bin2.meta_lic bin/bin2.meta_lic notice:restricted",
"bin/bin2.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"highest.apex.meta_lic bin/bin1.meta_lic notice:restricted_if_statically_linked",
"highest.apex.meta_lic bin/bin2.meta_lic notice:restricted",
"highest.apex.meta_lic highest.apex.meta_lic notice:restricted:restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic highest.apex.meta_lic notice:restricted:restricted_if_statically_linked",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"highest.apex.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"lib/libb.so.meta_lic lib/libb.so.meta_lic restricted",
},
},
@@ -590,18 +590,18 @@ func Test_plaintext(t *testing.T) {
stripPrefix: []string{"testdata/restricted/"},
},
expectedOut: []string{
"bin/bin1.meta_lic bin/bin1.meta_lic restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic bin/bin1.meta_lic restricted_if_statically_linked",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"bin/bin2.meta_lic bin/bin2.meta_lic restricted",
"bin/bin2.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic bin/bin1.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic bin/bin1.meta_lic restricted_if_statically_linked",
"highest.apex.meta_lic bin/bin2.meta_lic restricted",
"highest.apex.meta_lic highest.apex.meta_lic restricted:restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic highest.apex.meta_lic restricted:restricted_if_statically_linked",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"highest.apex.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"lib/libb.so.meta_lic lib/libb.so.meta_lic restricted",
},
},
@@ -624,18 +624,18 @@ func Test_plaintext(t *testing.T) {
stripPrefix: []string{"testdata/restricted/"},
},
expectedOut: []string{
"bin/bin1.meta_lic bin/bin1.meta_lic restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic bin/bin1.meta_lic restricted_if_statically_linked",
"bin/bin1.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"bin/bin1.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"bin/bin2.meta_lic bin/bin2.meta_lic restricted",
"bin/bin2.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic bin/bin1.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic bin/bin1.meta_lic restricted_if_statically_linked",
"highest.apex.meta_lic bin/bin2.meta_lic restricted",
"highest.apex.meta_lic highest.apex.meta_lic restricted:restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic highest.apex.meta_lic restricted:restricted_if_statically_linked",
"highest.apex.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"highest.apex.meta_lic lib/libb.so.meta_lic restricted",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"highest.apex.meta_lic lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"lib/liba.so.meta_lic lib/liba.so.meta_lic restricted_if_statically_linked",
"lib/libb.so.meta_lic lib/libb.so.meta_lic restricted",
},
},
@@ -645,18 +645,18 @@ func Test_plaintext(t *testing.T) {
roots: []string{"highest.apex.meta_lic"},
ctx: context{stripPrefix: []string{"testdata/restricted/"}, labelConditions: true},
expectedOut: []string{
"bin/bin1.meta_lic:notice bin/bin1.meta_lic:notice notice:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic:notice lib/liba.so.meta_lic:restricted_allows_dynamic_linking restricted_allows_dynamic_linking",
"bin/bin1.meta_lic:notice lib/libc.a.meta_lic:reciprocal reciprocal:restricted_allows_dynamic_linking",
"bin/bin1.meta_lic:notice bin/bin1.meta_lic:notice notice:restricted_if_statically_linked",
"bin/bin1.meta_lic:notice lib/liba.so.meta_lic:restricted_if_statically_linked restricted_if_statically_linked",
"bin/bin1.meta_lic:notice lib/libc.a.meta_lic:reciprocal reciprocal:restricted_if_statically_linked",
"bin/bin2.meta_lic:notice bin/bin2.meta_lic:notice notice:restricted",
"bin/bin2.meta_lic:notice lib/libb.so.meta_lic:restricted restricted",
"highest.apex.meta_lic:notice bin/bin1.meta_lic:notice notice:restricted_allows_dynamic_linking",
"highest.apex.meta_lic:notice bin/bin1.meta_lic:notice notice:restricted_if_statically_linked",
"highest.apex.meta_lic:notice bin/bin2.meta_lic:notice notice:restricted",
"highest.apex.meta_lic:notice highest.apex.meta_lic:notice notice:restricted:restricted_allows_dynamic_linking",
"highest.apex.meta_lic:notice lib/liba.so.meta_lic:restricted_allows_dynamic_linking restricted_allows_dynamic_linking",
"highest.apex.meta_lic:notice highest.apex.meta_lic:notice notice:restricted:restricted_if_statically_linked",
"highest.apex.meta_lic:notice lib/liba.so.meta_lic:restricted_if_statically_linked restricted_if_statically_linked",
"highest.apex.meta_lic:notice lib/libb.so.meta_lic:restricted restricted",
"highest.apex.meta_lic:notice lib/libc.a.meta_lic:reciprocal reciprocal:restricted_allows_dynamic_linking",
"lib/liba.so.meta_lic:restricted_allows_dynamic_linking lib/liba.so.meta_lic:restricted_allows_dynamic_linking restricted_allows_dynamic_linking",
"highest.apex.meta_lic:notice lib/libc.a.meta_lic:reciprocal reciprocal:restricted_if_statically_linked",
"lib/liba.so.meta_lic:restricted_if_statically_linked lib/liba.so.meta_lic:restricted_if_statically_linked restricted_if_statically_linked",
"lib/libb.so.meta_lic:restricted lib/libb.so.meta_lic:restricted restricted",
},
},
@@ -665,18 +665,18 @@ func Test_plaintext(t *testing.T) {
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"testdata/restricted/bin/bin2.meta_lic testdata/restricted/bin/bin2.meta_lic notice:restricted",
"testdata/restricted/bin/bin2.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
"testdata/restricted/container.zip.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"testdata/restricted/container.zip.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_if_statically_linked",
"testdata/restricted/container.zip.meta_lic testdata/restricted/bin/bin2.meta_lic notice:restricted",
"testdata/restricted/container.zip.meta_lic testdata/restricted/container.zip.meta_lic notice:restricted:restricted_allows_dynamic_linking",
"testdata/restricted/container.zip.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/container.zip.meta_lic testdata/restricted/container.zip.meta_lic notice:restricted:restricted_if_statically_linked",
"testdata/restricted/container.zip.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/container.zip.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
"testdata/restricted/container.zip.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"testdata/restricted/lib/liba.so.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/container.zip.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
"testdata/restricted/lib/liba.so.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/lib/libb.so.meta_lic testdata/restricted/lib/libb.so.meta_lic restricted",
},
},
@@ -685,8 +685,8 @@ func Test_plaintext(t *testing.T) {
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{
"testdata/restricted/application.meta_lic testdata/restricted/application.meta_lic notice:restricted:restricted_allows_dynamic_linking",
"testdata/restricted/application.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted:restricted_allows_dynamic_linking",
"testdata/restricted/application.meta_lic testdata/restricted/application.meta_lic notice:restricted:restricted_if_statically_linked",
"testdata/restricted/application.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted:restricted_if_statically_linked",
},
},
{
@@ -694,9 +694,9 @@ func Test_plaintext(t *testing.T) {
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_allows_dynamic_linking",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/bin/bin1.meta_lic notice:restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/bin/bin1.meta_lic testdata/restricted/lib/libc.a.meta_lic reciprocal:restricted_if_statically_linked",
},
},
{
@@ -2235,17 +2235,17 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/bin/bin2.meta_lic",
"testdata/restricted/bin/bin2.meta_lic",
@@ -2258,7 +2258,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"testdata/restricted/highest.apex.meta_lic",
"testdata/restricted/bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/highest.apex.meta_lic",
@@ -2269,12 +2269,12 @@ func Test_graphviz(t *testing.T) {
"testdata/restricted/highest.apex.meta_lic",
"testdata/restricted/highest.apex.meta_lic",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/highest.apex.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/highest.apex.meta_lic",
"testdata/restricted/lib/libb.so.meta_lic",
@@ -2283,11 +2283,11 @@ func Test_graphviz(t *testing.T) {
"testdata/restricted/highest.apex.meta_lic",
"testdata/restricted/lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/lib/liba.so.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/lib/libb.so.meta_lic",
"testdata/restricted/lib/libb.so.meta_lic",
@@ -2309,17 +2309,17 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"bin/bin1.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"bin/bin1.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin2.meta_lic",
"bin/bin2.meta_lic",
@@ -2332,7 +2332,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"highest.apex.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"highest.apex.meta_lic",
@@ -2343,12 +2343,12 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"highest.apex.meta_lic",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"highest.apex.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/libb.so.meta_lic",
@@ -2357,11 +2357,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/liba.so.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/libb.so.meta_lic",
"lib/libb.so.meta_lic",
@@ -2420,16 +2420,16 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"bin/bin1.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin2.meta_lic",
"bin/bin2.meta_lic",
@@ -2441,7 +2441,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"highest.apex.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"bin/bin2.meta_lic",
@@ -2450,11 +2450,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"highest.apex.meta_lic",
"restricted",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/libb.so.meta_lic",
@@ -2463,11 +2463,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/liba.so.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/libb.so.meta_lic",
"lib/libb.so.meta_lic",
@@ -2502,16 +2502,16 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"bin/bin1.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin2.meta_lic",
"bin/bin2.meta_lic",
@@ -2523,7 +2523,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"highest.apex.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"bin/bin2.meta_lic",
@@ -2532,11 +2532,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"highest.apex.meta_lic",
"restricted",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/libb.so.meta_lic",
@@ -2545,11 +2545,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/liba.so.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/libb.so.meta_lic",
"lib/libb.so.meta_lic",
@@ -2563,7 +2563,7 @@ func Test_graphviz(t *testing.T) {
ctx: context{stripPrefix: []string{"testdata/restricted/"}, labelConditions: true},
expectedOut: []getMatcher{
matchTarget("bin/bin1.meta_lic", "notice"),
matchTarget("lib/liba.so.meta_lic", "restricted_allows_dynamic_linking"),
matchTarget("lib/liba.so.meta_lic", "restricted_if_statically_linked"),
matchTarget("lib/libc.a.meta_lic", "reciprocal"),
matchTarget("bin/bin2.meta_lic", "notice"),
matchTarget("lib/libb.so.meta_lic", "restricted"),
@@ -2571,17 +2571,17 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"bin/bin1.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"bin/bin1.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin1.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"bin/bin2.meta_lic",
"bin/bin2.meta_lic",
@@ -2594,7 +2594,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"highest.apex.meta_lic",
"bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"highest.apex.meta_lic",
@@ -2605,12 +2605,12 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"highest.apex.meta_lic",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"highest.apex.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"highest.apex.meta_lic",
"lib/libb.so.meta_lic",
@@ -2619,11 +2619,11 @@ func Test_graphviz(t *testing.T) {
"highest.apex.meta_lic",
"lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/liba.so.meta_lic",
"lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"lib/libb.so.meta_lic",
"lib/libb.so.meta_lic",
@@ -2644,17 +2644,17 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/bin/bin2.meta_lic",
"testdata/restricted/bin/bin2.meta_lic",
@@ -2667,7 +2667,7 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"testdata/restricted/container.zip.meta_lic",
"testdata/restricted/bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/container.zip.meta_lic",
@@ -2678,12 +2678,12 @@ func Test_graphviz(t *testing.T) {
"testdata/restricted/container.zip.meta_lic",
"testdata/restricted/container.zip.meta_lic",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/container.zip.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/container.zip.meta_lic",
"testdata/restricted/lib/libb.so.meta_lic",
@@ -2692,11 +2692,11 @@ func Test_graphviz(t *testing.T) {
"testdata/restricted/container.zip.meta_lic",
"testdata/restricted/lib/libc.a.meta_lic",
"reciprocal",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/lib/liba.so.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/lib/libb.so.meta_lic",
"testdata/restricted/lib/libb.so.meta_lic",
@@ -2714,12 +2714,12 @@ func Test_graphviz(t *testing.T) {
"testdata/restricted/application.meta_lic",
"testdata/restricted/application.meta_lic",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/application.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"restricted"),
},
},
@@ -2734,16 +2734,16 @@ func Test_graphviz(t *testing.T) {
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/bin/bin1.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"notice"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/liba.so.meta_lic",
"restricted_allows_dynamic_linking"),
"restricted_if_statically_linked"),
matchResolution(
"testdata/restricted/bin/bin1.meta_lic",
"testdata/restricted/lib/libc.a.meta_lic",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"reciprocal"),
},
},

View File

@@ -187,7 +187,7 @@ func Test(t *testing.T) {
},
{
project: "device/library",
conditions: []string{"restricted_allows_dynamic_linking"},
conditions: []string{"restricted_if_statically_linked"},
},
{
project: "dynamic/binary",
@@ -196,14 +196,14 @@ func Test(t *testing.T) {
{
project: "static/binary",
conditions: []string{
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
{
project: "static/library",
conditions: []string{
"reciprocal",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
},
@@ -219,7 +219,7 @@ func Test(t *testing.T) {
},
{
project: "device/library",
conditions: []string{"restricted_allows_dynamic_linking"},
conditions: []string{"restricted_if_statically_linked"},
},
{
project: "dynamic/binary",
@@ -228,14 +228,14 @@ func Test(t *testing.T) {
{
project: "static/binary",
conditions: []string{
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
{
project: "static/library",
conditions: []string{
"reciprocal",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
},
@@ -249,14 +249,14 @@ func Test(t *testing.T) {
project: "device/library",
conditions: []string{
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
{
project: "distributable/application",
conditions: []string{
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
},
@@ -269,20 +269,20 @@ func Test(t *testing.T) {
{
project: "device/library",
conditions: []string{
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
{
project: "static/binary",
conditions: []string{
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
{
project: "static/library",
conditions: []string{
"reciprocal",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
},
},
},

View File

@@ -44,9 +44,9 @@ func Test_plaintext(t *testing.T) {
expectedOut []string
}{
{
condition: "firstparty",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
condition: "firstparty",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{},
},
{
@@ -60,33 +60,33 @@ func Test_plaintext(t *testing.T) {
expectedOut: []string{},
},
{
condition: "firstparty",
name: "container",
roots: []string{"container.zip.meta_lic"},
condition: "firstparty",
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{},
},
{
condition: "firstparty",
name: "application",
roots: []string{"application.meta_lic"},
condition: "firstparty",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{},
},
{
condition: "firstparty",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
condition: "firstparty",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{},
},
{
condition: "firstparty",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
condition: "firstparty",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
expectedOut: []string{},
},
{
condition: "notice",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
condition: "notice",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{},
},
{
@@ -100,33 +100,33 @@ func Test_plaintext(t *testing.T) {
expectedOut: []string{},
},
{
condition: "notice",
name: "container",
roots: []string{"container.zip.meta_lic"},
condition: "notice",
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{},
},
{
condition: "notice",
name: "application",
roots: []string{"application.meta_lic"},
condition: "notice",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{},
},
{
condition: "notice",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
condition: "notice",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{},
},
{
condition: "notice",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
condition: "notice",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
expectedOut: []string{},
},
{
condition: "reciprocal",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
condition: "reciprocal",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{},
},
{
@@ -140,27 +140,27 @@ func Test_plaintext(t *testing.T) {
expectedOut: []string{},
},
{
condition: "reciprocal",
name: "container",
roots: []string{"container.zip.meta_lic"},
condition: "reciprocal",
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{},
},
{
condition: "reciprocal",
name: "application",
roots: []string{"application.meta_lic"},
condition: "reciprocal",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{},
},
{
condition: "reciprocal",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
condition: "reciprocal",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{},
},
{
condition: "reciprocal",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
condition: "reciprocal",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
expectedOut: []string{},
},
{
@@ -168,7 +168,7 @@ func Test_plaintext(t *testing.T) {
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{
"testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/lib/libb.so.meta_lic restricted",
},
},
@@ -180,7 +180,7 @@ func Test_plaintext(t *testing.T) {
sources: []string{"testdata/restricted/bin/bin1.meta_lic"},
stripPrefix: []string{"testdata/restricted/"},
},
expectedOut: []string{"lib/liba.so.meta_lic restricted_allows_dynamic_linking"},
expectedOut: []string{"lib/liba.so.meta_lic restricted_if_statically_linked"},
},
{
condition: "restricted",
@@ -197,32 +197,32 @@ func Test_plaintext(t *testing.T) {
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{
"testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking",
"testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked",
"testdata/restricted/lib/libb.so.meta_lic restricted",
},
},
{
condition: "restricted",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{"testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking"},
condition: "restricted",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{"testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked"},
},
{
condition: "restricted",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{"testdata/restricted/lib/liba.so.meta_lic restricted_allows_dynamic_linking"},
condition: "restricted",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{"testdata/restricted/lib/liba.so.meta_lic restricted_if_statically_linked"},
},
{
condition: "restricted",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
condition: "restricted",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
expectedOut: []string{},
},
{
condition: "proprietary",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
condition: "proprietary",
name: "apex",
roots: []string{"highest.apex.meta_lic"},
expectedOut: []string{"testdata/proprietary/lib/libb.so.meta_lic restricted"},
},
{
@@ -246,27 +246,27 @@ func Test_plaintext(t *testing.T) {
expectedOut: []string{"lib/libb.so.meta_lic restricted"},
},
{
condition: "proprietary",
name: "container",
roots: []string{"container.zip.meta_lic"},
condition: "proprietary",
name: "container",
roots: []string{"container.zip.meta_lic"},
expectedOut: []string{"testdata/proprietary/lib/libb.so.meta_lic restricted"},
},
{
condition: "proprietary",
name: "application",
roots: []string{"application.meta_lic"},
condition: "proprietary",
name: "application",
roots: []string{"application.meta_lic"},
expectedOut: []string{},
},
{
condition: "proprietary",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
condition: "proprietary",
name: "binary",
roots: []string{"bin/bin1.meta_lic"},
expectedOut: []string{},
},
{
condition: "proprietary",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
condition: "proprietary",
name: "library",
roots: []string{"lib/libd.so.meta_lic"},
expectedOut: []string{},
},
}

View File

@@ -2,7 +2,7 @@ package_name: "Compiler"
module_classes: "EXECUTABLES"
projects: "standalone/binary"
license_kinds: "SPDX-license-identifier-LGPL-2.0"
license_conditions: "restricted_allows_dynamic_linking"
license_conditions: "restricted_if_statically_linked"
license_texts: "testdata/restricted/RESTRICTED_LICENSE"
is_container: false
built: "out/target/product/fictional/obj/EXECUTABLES/bin_intermediates/bin3"

View File

@@ -2,7 +2,7 @@ package_name: "Compiler"
module_classes: "EXECUTABLES"
projects: "standalone/binary"
license_kinds: "SPDX-license-identifier-LGPL-2.0"
license_conditions: "restricted_allows_dynamic_linking"
license_conditions: "restricted_if_statically_linked"
license_texts: "testdata/restricted/RESTRICTED_LICENSE"
is_container: false
built: "out/target/product/fictional/obj/EXECUTABLES/bin_intermediates/bin3"

View File

@@ -1,7 +1,7 @@
package_name: "Device"
projects: "device/library"
license_kinds: "SPDX-license-identifier-LGPL-2.0"
license_conditions: "restricted_allows_dynamic_linking"
license_conditions: "restricted_if_statically_linked"
license_texts: "testdata/restricted/RESTRICTED_LICENSE"
is_container: false
built: "out/target/product/fictional/obj/SHARED_LIBRARIES/lib_intermediates/liba.so"

View File

@@ -58,15 +58,15 @@ const (
var (
// RecognizedConditionNames maps condition strings to LicenseCondition.
RecognizedConditionNames = map[string]LicenseCondition{
"unencumbered": UnencumberedCondition,
"permissive": PermissiveCondition,
"notice": NoticeCondition,
"reciprocal": ReciprocalCondition,
"restricted": RestrictedCondition,
"restricted_allows_dynamic_linking": WeaklyRestrictedCondition,
"proprietary": ProprietaryCondition,
"by_exception_only": ByExceptionOnlyCondition,
"not_allowed": NotAllowedCondition,
"unencumbered": UnencumberedCondition,
"permissive": PermissiveCondition,
"notice": NoticeCondition,
"reciprocal": ReciprocalCondition,
"restricted": RestrictedCondition,
"restricted_if_statically_linked": WeaklyRestrictedCondition,
"proprietary": ProprietaryCondition,
"by_exception_only": ByExceptionOnlyCondition,
"not_allowed": NotAllowedCondition,
}
)
@@ -84,7 +84,7 @@ func (lc LicenseCondition) Name() string {
case RestrictedCondition:
return "restricted"
case WeaklyRestrictedCondition:
return "restricted_allows_dynamic_linking"
return "restricted_if_statically_linked"
case ProprietaryCondition:
return "proprietary"
case ByExceptionOnlyCondition:

View File

@@ -96,18 +96,18 @@ func TestConditionSet(t *testing.T) {
{
name: "everything",
conditions: []string{"unencumbered", "permissive", "notice", "reciprocal", "restricted", "proprietary"},
plus: &[]string{"restricted_allows_dynamic_linking", "by_exception_only", "not_allowed"},
plus: &[]string{"restricted_if_statically_linked", "by_exception_only", "not_allowed"},
matchingAny: map[string][]string{
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_allows_dynamic_linking": []string{"restricted_allows_dynamic_linking"},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"notice|proprietary": []string{"notice", "proprietary"},
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_if_statically_linked": []string{"restricted_if_statically_linked"},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"notice|proprietary": []string{"notice", "proprietary"},
},
expected: []string{
"unencumbered",
@@ -115,7 +115,7 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
@@ -129,7 +129,7 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
@@ -148,7 +148,7 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
@@ -157,18 +157,18 @@ func TestConditionSet(t *testing.T) {
{
name: "allbutone",
conditions: []string{"unencumbered", "permissive", "notice", "reciprocal", "restricted", "proprietary"},
plus: &[]string{"restricted_allows_dynamic_linking", "by_exception_only", "not_allowed"},
plus: &[]string{"restricted_if_statically_linked", "by_exception_only", "not_allowed"},
matchingAny: map[string][]string{
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_allows_dynamic_linking": []string{"restricted_allows_dynamic_linking"},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"notice|proprietary": []string{"notice", "proprietary"},
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_if_statically_linked": []string{"restricted_if_statically_linked"},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"notice|proprietary": []string{"notice", "proprietary"},
},
expected: []string{
"unencumbered",
@@ -176,7 +176,7 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
@@ -190,23 +190,23 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
},
minus: &[]string{"restricted_allows_dynamic_linking"},
minus: &[]string{"restricted_if_statically_linked"},
matchingAny: map[string][]string{
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_allows_dynamic_linking": []string{},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"restricted|proprietary": []string{"restricted", "proprietary"},
"unencumbered": []string{"unencumbered"},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"reciprocal": []string{"reciprocal"},
"restricted": []string{"restricted"},
"restricted_if_statically_linked": []string{},
"proprietary": []string{"proprietary"},
"by_exception_only": []string{"by_exception_only"},
"not_allowed": []string{"not_allowed"},
"restricted|proprietary": []string{"restricted", "proprietary"},
},
expected: []string{
"unencumbered",
@@ -227,7 +227,7 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
@@ -238,41 +238,41 @@ func TestConditionSet(t *testing.T) {
"notice",
"reciprocal",
"restricted",
"restricted_allows_dynamic_linking",
"restricted_if_statically_linked",
"proprietary",
"by_exception_only",
"not_allowed",
},
matchingAny: map[string][]string{
"unencumbered": []string{},
"permissive": []string{},
"notice": []string{},
"reciprocal": []string{},
"restricted": []string{},
"restricted_allows_dynamic_linking": []string{},
"proprietary": []string{},
"by_exception_only": []string{},
"not_allowed": []string{},
"restricted|proprietary": []string{},
"unencumbered": []string{},
"permissive": []string{},
"notice": []string{},
"reciprocal": []string{},
"restricted": []string{},
"restricted_if_statically_linked": []string{},
"proprietary": []string{},
"by_exception_only": []string{},
"not_allowed": []string{},
"restricted|proprietary": []string{},
},
expected: []string{},
},
{
name: "restrictedplus",
conditions: []string{"restricted", "restricted_allows_dynamic_linking"},
conditions: []string{"restricted", "restricted_if_statically_linked"},
plus: &[]string{"permissive", "notice", "restricted", "proprietary"},
matchingAny: map[string][]string{
"unencumbered": []string{},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"restricted": []string{"restricted"},
"restricted_allows_dynamic_linking": []string{"restricted_allows_dynamic_linking"},
"proprietary": []string{"proprietary"},
"restricted|proprietary": []string{"restricted", "proprietary"},
"by_exception_only": []string{},
"proprietary|by_exception_only": []string{"proprietary"},
"unencumbered": []string{},
"permissive": []string{"permissive"},
"notice": []string{"notice"},
"restricted": []string{"restricted"},
"restricted_if_statically_linked": []string{"restricted_if_statically_linked"},
"proprietary": []string{"proprietary"},
"restricted|proprietary": []string{"restricted", "proprietary"},
"by_exception_only": []string{},
"proprietary|by_exception_only": []string{"proprietary"},
},
expected: []string{"permissive", "notice", "restricted", "restricted_allows_dynamic_linking", "proprietary"},
expected: []string{"permissive", "notice", "restricted", "restricted_if_statically_linked", "proprietary"},
},
}
for _, tt := range tests {

View File

@@ -49,8 +49,8 @@ func TestPolicy_edgeConditions(t *testing.T) {
name: "fponlgpl",
edge: annotated{"apacheBin.meta_lic", "lgplLib.meta_lic", []string{"static"}},
expectedDepActions: []string{
"apacheBin.meta_lic:lgplLib.meta_lic:restricted_allows_dynamic_linking",
"lgplLib.meta_lic:lgplLib.meta_lic:restricted_allows_dynamic_linking",
"apacheBin.meta_lic:lgplLib.meta_lic:restricted_if_statically_linked",
"lgplLib.meta_lic:lgplLib.meta_lic:restricted_if_statically_linked",
},
expectedTargetConditions: []string{},
},
@@ -85,15 +85,15 @@ func TestPolicy_edgeConditions(t *testing.T) {
expectedTargetConditions: []string{},
},
{
name: "independentmodulestatic",
edge: annotated{"apacheBin.meta_lic", "gplWithClasspathException.meta_lic", []string{"static"}},
expectedDepActions: []string{},
name: "independentmodulestatic",
edge: annotated{"apacheBin.meta_lic", "gplWithClasspathException.meta_lic", []string{"static"}},
expectedDepActions: []string{},
expectedTargetConditions: []string{},
},
{
name: "dependentmodule",
edge: annotated{"dependentModule.meta_lic", "gplWithClasspathException.meta_lic", []string{"dynamic"}},
expectedDepActions: []string{},
name: "dependentmodule",
edge: annotated{"dependentModule.meta_lic", "gplWithClasspathException.meta_lic", []string{"dynamic"}},
expectedDepActions: []string{},
expectedTargetConditions: []string{},
},
@@ -101,7 +101,7 @@ func TestPolicy_edgeConditions(t *testing.T) {
name: "lgplonfp",
edge: annotated{"lgplBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
expectedDepActions: []string{},
expectedTargetConditions: []string{"lgplBin.meta_lic:restricted_allows_dynamic_linking"},
expectedTargetConditions: []string{"lgplBin.meta_lic:restricted_if_statically_linked"},
},
{
name: "lgplonfpdynamic",

View File

@@ -204,8 +204,8 @@ func TestResolveBottomUpConditions(t *testing.T) {
{"apacheBin.meta_lic", "lgplLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "notice|restricted_if_statically_linked"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -216,7 +216,7 @@ func TestResolveBottomUpConditions(t *testing.T) {
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -227,9 +227,9 @@ func TestResolveBottomUpConditions(t *testing.T) {
{"apacheBin.meta_lic", "lgplLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "notice|restricted_if_statically_linked"},
{"apacheBin.meta_lic", "notice|restricted_if_statically_linked"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -240,9 +240,9 @@ func TestResolveBottomUpConditions(t *testing.T) {
{"apacheContainer.meta_lic", "lgplLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "notice|restricted_if_statically_linked"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -253,7 +253,7 @@ func TestResolveBottomUpConditions(t *testing.T) {
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -266,7 +266,7 @@ func TestResolveBottomUpConditions(t *testing.T) {
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -279,7 +279,7 @@ func TestResolveBottomUpConditions(t *testing.T) {
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -500,9 +500,9 @@ func TestResolveTopDownConditions(t *testing.T) {
{"apacheBin.meta_lic", "mitLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"mitLib.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "notice|restricted_if_statically_linked"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
{"mitLib.meta_lic", "notice|restricted_if_statically_linked"},
},
},
{
@@ -514,7 +514,7 @@ func TestResolveTopDownConditions(t *testing.T) {
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice"},
{"lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "restricted_if_statically_linked"},
{"mitLib.meta_lic", "notice"},
},
},
@@ -527,10 +527,10 @@ func TestResolveTopDownConditions(t *testing.T) {
{"apacheBin.meta_lic", "mitLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"mitLib.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "notice|restricted_if_statically_linked"},
{"apacheBin.meta_lic", "notice|restricted_if_statically_linked"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
{"mitLib.meta_lic", "notice|restricted_if_statically_linked"},
},
},
{
@@ -541,9 +541,9 @@ func TestResolveTopDownConditions(t *testing.T) {
{"apacheContainer.meta_lic", "lgplLib.meta_lic", []string{"static"}},
},
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice|restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "notice|restricted_if_statically_linked"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -555,7 +555,7 @@ func TestResolveTopDownConditions(t *testing.T) {
},
expectedActions: []tcond{
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
{"mitLib.meta_lic", "notice"},
},
},
@@ -569,7 +569,7 @@ func TestResolveTopDownConditions(t *testing.T) {
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -582,7 +582,7 @@ func TestResolveTopDownConditions(t *testing.T) {
expectedActions: []tcond{
{"apacheContainer.meta_lic", "notice"},
{"apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{

View File

@@ -217,10 +217,10 @@ func TestResolveNotices(t *testing.T) {
},
expectedResolutions: []res{
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "mitLib.meta_lic", "notice"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -245,7 +245,7 @@ func TestResolveNotices(t *testing.T) {
expectedResolutions: []res{
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "mitLib.meta_lic", "notice"},
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -258,17 +258,17 @@ func TestResolveNotices(t *testing.T) {
},
expectedResolutions: []res{
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "apacheContainer.meta_lic", "notice"},
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheContainer.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheContainer.meta_lic", "mitLib.meta_lic", "mitLib.meta_lic", "notice"},
{"apacheContainer.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "mitLib.meta_lic", "notice"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -280,11 +280,11 @@ func TestResolveNotices(t *testing.T) {
},
expectedResolutions: []res{
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "apacheContainer.meta_lic", "notice"},
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheContainer.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"apacheContainer.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -309,7 +309,7 @@ func TestResolveNotices(t *testing.T) {
expectedResolutions: []res{
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "mitLib.meta_lic", "mitLib.meta_lic", "notice"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -336,7 +336,7 @@ func TestResolveNotices(t *testing.T) {
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "apacheContainer.meta_lic", "notice"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -363,7 +363,7 @@ func TestResolveNotices(t *testing.T) {
{"apacheContainer.meta_lic", "apacheContainer.meta_lic", "apacheContainer.meta_lic", "notice"},
{"apacheContainer.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"apacheBin.meta_lic", "apacheBin.meta_lic", "apacheBin.meta_lic", "notice"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplLib.meta_lic", "lgplLib.meta_lic", "lgplLib.meta_lic", "restricted_if_statically_linked"},
},
},
{

View File

@@ -73,8 +73,8 @@ func TestResolveSourceSharing(t *testing.T) {
{"lgplBin.meta_lic", "apacheLib.meta_lic", []string{"static"}},
},
expectedResolutions: []res{
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "apacheLib.meta_lic", "lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_if_statically_linked"},
{"lgplBin.meta_lic", "apacheLib.meta_lic", "lgplBin.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -84,7 +84,7 @@ func TestResolveSourceSharing(t *testing.T) {
{"lgplBin.meta_lic", "apacheLib.meta_lic", []string{"dynamic"}},
},
expectedResolutions: []res{
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_if_statically_linked"},
},
},
{
@@ -94,7 +94,7 @@ func TestResolveSourceSharing(t *testing.T) {
{"lgplBin.meta_lic", "apacheLib.meta_lic", []string{"dynamic"}},
},
expectedResolutions: []res{
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_allows_dynamic_linking"},
{"lgplBin.meta_lic", "lgplBin.meta_lic", "lgplBin.meta_lic", "restricted_if_statically_linked"},
},
},
{

View File

@@ -57,7 +57,7 @@ license_conditions: "notice"
LGPL = `` +
`package_name: "Free Library"
license_kinds: "SPDX-license-identifier-LGPL-2.0"
license_conditions: "restricted_allows_dynamic_linking"
license_conditions: "restricted_if_statically_linked"
`
// MPL starts a test metadata file for a module with MPL 2.0 reciprical licensing.