Projects STRLCPY syft Commits 5a7bab97
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    .github/workflows/validations.yaml
    skipped 33 lines
    34 34   uses: ./.github/actions/bootstrap
    35 35   
    36 36   - name: Restore Java test-fixture cache
    37  - id: unit-java-cache
    38 37   uses: actions/cache@v3
    39 38   with:
    40 39   path: syft/pkg/cataloger/java/test-fixtures/java-builds/packages
    41 40   key: ${{ runner.os }}-unit-java-cache-${{ hashFiles( 'syft/pkg/cataloger/java/test-fixtures/java-builds/packages.fingerprint' ) }}
    42 41   
    43 42   - name: Restore RPM test-fixture cache
    44  - id: unit-rpm-cache
    45 43   uses: actions/cache@v3
    46 44   with:
    47 45   path: syft/pkg/cataloger/rpm/test-fixtures/rpms
    48 46   key: ${{ runner.os }}-unit-rpm-cache-${{ hashFiles( 'syft/pkg/cataloger/rpm/test-fixtures/rpms.fingerprint' ) }}
    49 47   
    50 48   - name: Restore go binary test-fixture cache
    51  - id: unit-go-binary-cache
    52 49   uses: actions/cache@v3
    53 50   with:
    54 51   path: syft/pkg/cataloger/golang/test-fixtures/archs/binaries
    55 52   key: ${{ runner.os }}-unit-go-binaries-cache-${{ hashFiles( 'syft/pkg/cataloger/golang/test-fixtures/archs/binaries.fingerprint' ) }}
    56 53   
    57 54   - name: Restore binary cataloger test-fixture cache
    58  - id: unit-binary-cataloger-cache
    59 55   uses: actions/cache@v3
    60 56   with:
    61 57   path: syft/pkg/cataloger/binary/test-fixtures/classifiers/dynamic
    62 58   key: ${{ runner.os }}-unit-binary-cataloger-cache-${{ hashFiles( 'syft/pkg/cataloger/binary/test-fixtures/cache.fingerprint' ) }}
     59 + 
     60 + - name: Restore Kernel test-fixture cache
     61 + uses: actions/cache@v3
     62 + with:
     63 + path: syft/pkg/cataloger/kernel/test-fixtures/cache
     64 + key: ${{ runner.os }}-unit-kernel-cache-${{ hashFiles( 'syft/pkg/cataloger/kernel/test-fixtures/cache.fingerprint' ) }}
    63 65   
    64 66   - name: Run unit tests
    65 67   run: make unit
    skipped 144 lines
  • ■ ■ ■ ■ ■ ■
    Makefile
    skipped 208 lines
    209 209   cd syft/pkg/cataloger/rpm/test-fixtures && \
    210 210   make rpms.fingerprint
    211 211   
     212 + # for Kernel test fixtures
     213 + cd syft/pkg/cataloger/kernel/test-fixtures && \
     214 + make cache.fingerprint
     215 + 
    212 216   # for INSTALL integration test fixtures
    213 217   cd test/install && \
    214 218   make cache.fingerprint
    skipped 178 lines
  • ■ ■ ■ ■ ■ ■
    syft/pkg/cataloger/kernel/cataloger_test.go
    skipped 8 lines
    9 9   "github.com/anchore/syft/syft/source"
    10 10  )
    11 11   
    12  -func Test_JavascriptCataloger(t *testing.T) {
     12 +func Test_KernelCataloger(t *testing.T) {
    13 13   kernelPkg := pkg.Package{
    14 14   Name: "linux-kernel",
    15  - Version: "6.2.9-200.fc37.x86_64",
     15 + Version: "6.0.7-301.fc37.x86_64",
    16 16   FoundBy: "linux-kernel-cataloger",
    17 17   Locations: source.NewLocationSet(
    18 18   source.NewVirtualLocation(
    19  - "/lib/modules/6.2.9-200.fc37.x86_64/vmlinuz",
    20  - "/lib/modules/6.2.9-200.fc37.x86_64/vmlinuz",
     19 + "/lib/modules/6.0.7-301.fc37.x86_64/vmlinuz",
     20 + "/lib/modules/6.0.7-301.fc37.x86_64/vmlinuz",
    21 21   ),
    22 22   ),
    23 23   Type: pkg.LinuxKernelPkg,
    24  - PURL: "pkg:generic/linux-kernel@6.2.9-200.fc37.x86_64",
     24 + PURL: "pkg:generic/linux-kernel@6.0.7-301.fc37.x86_64",
    25 25   MetadataType: pkg.LinuxKernelMetadataType,
    26 26   Metadata: pkg.LinuxKernelMetadata{
    27 27   Name: "",
    28 28   Architecture: "x86",
    29  - Version: "6.2.9-200.fc37.x86_64",
    30  - ExtendedVersion: "6.2.9-200.fc37.x86_64 (mockbuild@bkernel02.iad2.fedoraproject.org) #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023",
     29 + Version: "6.0.7-301.fc37.x86_64",
     30 + ExtendedVersion: "6.0.7-301.fc37.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) #1 SMP PREEMPT_DYNAMIC Fri Nov 4 18:35:48 UTC 2022",
    31 31   BuildTime: "",
    32 32   Author: "",
    33 33   Format: "bzImage",
    skipped 5 lines
    39 39   }
    40 40   
    41 41   kernelModulePkg := pkg.Package{
    42  - Name: "fsa4480",
     42 + Name: "ttynull",
    43 43   Version: "",
    44 44   FoundBy: "linux-kernel-cataloger",
    45 45   Locations: source.NewLocationSet(
    46  - source.NewVirtualLocation("/lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko",
    47  - "/lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko",
     46 + source.NewVirtualLocation("/lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko",
     47 + "/lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko",
    48 48   ),
    49 49   ),
    50 50   Licenses: []string{
    51 51   "GPL v2",
    52 52   },
    53 53   Type: pkg.LinuxKernelModulePkg,
    54  - PURL: "pkg:generic/fsa4480",
     54 + PURL: "pkg:generic/ttynull",
    55 55   MetadataType: pkg.LinuxKernelModuleMetadataType,
    56 56   Metadata: pkg.LinuxKernelModuleMetadata{
    57  - Name: "fsa4480",
     57 + Name: "ttynull",
    58 58   Version: "",
    59 59   SourceVersion: "",
    60 60   License: "GPL v2",
    61  - Path: "/lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko",
    62  - Description: "ON Semiconductor FSA4480 driver",
    63  - KernelVersion: "6.2.9-200.fc37.x86_64",
    64  - VersionMagic: "6.2.9-200.fc37.x86_64 SMP preempt mod_unload ",
     61 + Path: "/lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko",
     62 + Description: "",
     63 + KernelVersion: "6.0.7-301.fc37.x86_64",
     64 + VersionMagic: "6.0.7-301.fc37.x86_64 SMP preempt mod_unload ",
    65 65   Parameters: map[string]pkg.LinuxKernelModuleParameter{},
    66 66   },
    67 67   }
    skipped 26 lines
  • ■ ■ ■ ■ ■ ■
    syft/pkg/cataloger/kernel/test-fixtures/Makefile
     1 +all:
     2 + 
     3 +# we need a way to determine if CI should bust the test cache based on the source material
     4 +.PHONY: cache.fingerprint
     5 +cache.fingerprint:
     6 + find Makefile **/Dockerfile -type f -exec sha256sum {} \; | sort | tee /dev/stderr | tee cache.fingerprint
     7 + sha256sum cache.fingerprint
     8 + 
  • ■ ■ ■ ■ ■ ■
    syft/pkg/cataloger/kernel/test-fixtures/image-kernel-and-modules/Dockerfile
    1 1  FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2
    2 2   
    3 3  RUN dnf install 'dnf-command(download)' cpio xz -y
    4  -RUN dnf download kernel-core kernel-modules-core -y
     4 +# https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Everything/x86_64/os/Packages/k/kernel-6.0.7-301.fc37.x86_64.rpm
     5 +# https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Everything/x86_64/os/Packages/k/kernel-modules-6.0.7-301.fc37.x86_64.rpm
     6 +RUN dnf download kernel-core-6.0.7-301.fc37 kernel-modules-6.0.7-301.fc37 -y
    5 7   
    6 8  RUN rpm2cpio kernel-core-*.rpm | cpio -t && \
    7  - rpm2cpio kernel-core-*.rpm | cpio -idmv ./lib/modules/6.2.9-200.fc37.x86_64/vmlinuz
     9 + rpm2cpio kernel-core-*.rpm | cpio -idmv ./lib/modules/6.0.7-301.fc37.x86_64/vmlinuz
    8 10   
    9  -RUN rpm2cpio kernel-modules-core-*.rpm | cpio -t && \
    10  - rpm2cpio kernel-modules-core-*.rpm | cpio -idmv ./lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko.xz
     11 +RUN rpm2cpio kernel-modules-*.rpm | cpio -t && \
     12 + rpm2cpio kernel-modules-*.rpm | cpio -idmv ./lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko.xz
    11 13   
    12  -RUN unxz /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko.xz
     14 +RUN unxz /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko.xz
    13 15   
    14 16  FROM scratch
    15 17   
    16  -COPY --from=0 /lib/modules/6.2.9-200.fc37.x86_64/vmlinuz /lib/modules/6.2.9-200.fc37.x86_64/vmlinuz
    17  -COPY --from=0 /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko
     18 +COPY --from=0 /lib/modules/6.0.7-301.fc37.x86_64/vmlinuz /lib/modules/6.0.7-301.fc37.x86_64/vmlinuz
     19 +COPY --from=0 /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko
    18 20   
  • ■ ■ ■ ■ ■ ■
    test/integration/catalog_packages_cases_test.go
    skipped 14 lines
    15 15   name: "find kernel packages",
    16 16   pkgType: pkg.LinuxKernelPkg,
    17 17   pkgInfo: map[string]string{
    18  - "linux-kernel": "6.2.9-200.fc37.x86_64",
     18 + "linux-kernel": "6.0.7-301.fc37.x86_64",
    19 19   },
    20 20   },
    21 21   {
    22 22   name: "find kernel module packages",
    23 23   pkgType: pkg.LinuxKernelModulePkg,
    24 24   pkgInfo: map[string]string{
    25  - "fsa4480": "",
     25 + "ttynull": "",
    26 26   },
    27 27   },
    28 28   {
    skipped 387 lines
  • ■ ■ ■ ■ ■ ■
    test/integration/test-fixtures/image-pkg-coverage/Dockerfile
    1 1  FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2
    2 2   
    3 3  RUN dnf install 'dnf-command(download)' cpio xz -y
    4  -RUN dnf download kernel-core kernel-modules-core -y
     4 +# https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Everything/x86_64/os/Packages/k/kernel-6.0.7-301.fc37.x86_64.rpm
     5 +# https://dl.fedoraproject.org/pub/fedora/linux/releases/37/Everything/x86_64/os/Packages/k/kernel-modules-6.0.7-301.fc37.x86_64.rpm
     6 +RUN dnf download kernel-core-6.0.7-301.fc37 kernel-modules-6.0.7-301.fc37 -y
    5 7   
    6 8  RUN rpm2cpio kernel-core-*.rpm | cpio -t && \
    7  - rpm2cpio kernel-core-*.rpm | cpio -idmv ./lib/modules/6.2.9-200.fc37.x86_64/vmlinuz
     9 + rpm2cpio kernel-core-*.rpm | cpio -idmv ./lib/modules/6.0.7-301.fc37.x86_64/vmlinuz
    8 10   
    9  -RUN rpm2cpio kernel-modules-core-*.rpm | cpio -t && \
    10  - rpm2cpio kernel-modules-core-*.rpm | cpio -idmv ./lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko.xz
     11 +RUN rpm2cpio kernel-modules-*.rpm | cpio -t && \
     12 + rpm2cpio kernel-modules-*.rpm | cpio -idmv ./lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko.xz
    11 13   
    12  -RUN unxz /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko.xz
     14 +RUN unxz /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko.xz
    13 15   
    14 16  FROM scratch
    15 17   
    16  -COPY --from=0 /lib/modules/6.2.9-200.fc37.x86_64/vmlinuz /lib/modules/6.2.9-200.fc37.x86_64/vmlinuz
    17  -COPY --from=0 /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko /lib/modules/6.2.9-200.fc37.x86_64/kernel/drivers/usb/typec/mux/fsa4480.ko
     18 +COPY --from=0 /lib/modules/6.0.7-301.fc37.x86_64/vmlinuz /lib/modules/6.0.7-301.fc37.x86_64/vmlinuz
     19 +COPY --from=0 /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/tty/ttynull.ko
    18 20   
    19 21  COPY pkgs/ .
    20 22  # we duplicate to show a package count difference between all-layers and squashed scopes
    skipped 3 lines
Please wait...
Page is in error, reload to recover