|
12 | 12 | // See the License for the specific language governing permissions and
|
13 | 13 | // limitations under the License.
|
14 | 14 |
|
| 15 | +//go:generate go run ./../../ build --generate-index=false --out-dir=./testdata/generated ./testdata/ld-so-conf-d-test.yaml --arch=x86_64 |
15 | 16 | //go:generate go run ./../../ build --generate-index=false --out-dir=./testdata/generated ./testdata/shbang-test.yaml --arch=x86_64
|
16 | 17 | //go:generate go run ./../../ build --generate-index=false --source-dir=./testdata/go-fips-bin/ --out-dir=./testdata/generated ./testdata/go-fips-bin/go-fips-bin.yaml --arch=x86_64
|
17 | 18 | //go:generate curl -s -o ./testdata/py3-seaborn.yaml https://raw.githubusercontent.com/wolfi-dev/os/7a39ac1d0603a3561790ea2201dd8ad7c2b7e51e/py3-seaborn.yaml
|
@@ -56,7 +57,7 @@ func (th *testHandle) Version() string {
|
56 | 57 |
|
57 | 58 | func (th *testHandle) RelativeNames() []string {
|
58 | 59 | // TODO: Support subpackages?
|
59 |
| - return []string{th.pkg.Origin} |
| 60 | + return []string{th.pkg.Name} |
60 | 61 | }
|
61 | 62 |
|
62 | 63 | func (th *testHandle) FilesystemForRelative(pkgName string) (SCAFS, error) {
|
@@ -337,3 +338,20 @@ func TestGetShbang(t *testing.T) {
|
337 | 338 | }
|
338 | 339 | }
|
339 | 340 | }
|
| 341 | + |
| 342 | +func TestLdSoConfD(t *testing.T) { |
| 343 | + ctx := slogtest.Context(t) |
| 344 | + // Generated with `go generate ./...` |
| 345 | + th := handleFromApk(ctx, t, "generated/x86_64/ld-so-conf-d-test-1-r1.apk", "ld-so-conf-d-test.yaml") |
| 346 | + defer th.exp.Close() |
| 347 | + |
| 348 | + if extraLibPaths, err := getLdSoConfDLibPaths(ctx, th); err != nil { |
| 349 | + t.Fatal(err) |
| 350 | + } else if extraLibPaths == nil { |
| 351 | + t.Error("getLdSoConfDLibPaths: expected 'my/lib/test', got nil") |
| 352 | + } else { |
| 353 | + if extraLibPaths[0] != "my/lib/test" { |
| 354 | + t.Errorf("getLdSoConfDLibPaths: expected 'my/lib/test', got '%s'", extraLibPaths[0]) |
| 355 | + } |
| 356 | + } |
| 357 | +} |
0 commit comments