From 95342499361b0c254c3dafc13699b6083ede7da3 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 23 Oct 2024 23:09:03 +0200 Subject: [PATCH] [no-relnote] Add test for libcuda lookup This change adds a test for locating libcuda as a driver library. This includes a failing test on a system where libcuda.so.1 is in the ldcache, but not at one of the predefined library search paths. A testdata folder with sample root filesystems is included to test various combinations. Signed-off-by: Evan Lezar --- internal/lookup/root/root_test.go | 81 ++++++++++++++++++ testdata/go.mod | 0 testdata/lookup/rootfs-1/README.md | 2 + testdata/lookup/rootfs-1/etc/ld.so.cache | Bin 0 -> 57276 bytes .../lib/x86_64-linux-gnu/libcuda.so.1 | 1 + .../lib/x86_64-linux-gnu/libcuda.so.999.88.77 | 0 testdata/lookup/rootfs-2/README.md | 3 + testdata/lookup/rootfs-2/etc/ld.so.cache | Bin 0 -> 43425 bytes .../var/lib/nvidia/lib64/libcuda.so.1 | 1 + .../var/lib/nvidia/lib64/libcuda.so.999.88.77 | 0 testdata/lookup/rootfs-empty/README.md | 1 + .../usr/lib64/libcuda.so.1 | 1 + .../usr/lib64/libcuda.so.999.88.77 | 0 13 files changed, 90 insertions(+) create mode 100644 internal/lookup/root/root_test.go create mode 100644 testdata/go.mod create mode 100644 testdata/lookup/rootfs-1/README.md create mode 100644 testdata/lookup/rootfs-1/etc/ld.so.cache create mode 120000 testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.1 create mode 100644 testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.999.88.77 create mode 100644 testdata/lookup/rootfs-2/README.md create mode 100644 testdata/lookup/rootfs-2/etc/ld.so.cache create mode 120000 testdata/lookup/rootfs-2/var/lib/nvidia/lib64/libcuda.so.1 create mode 100644 testdata/lookup/rootfs-2/var/lib/nvidia/lib64/libcuda.so.999.88.77 create mode 100644 testdata/lookup/rootfs-empty/README.md create mode 120000 testdata/lookup/rootfs-no-cache-lib64/usr/lib64/libcuda.so.1 create mode 100644 testdata/lookup/rootfs-no-cache-lib64/usr/lib64/libcuda.so.999.88.77 diff --git a/internal/lookup/root/root_test.go b/internal/lookup/root/root_test.go new file mode 100644 index 00000000..c256deb6 --- /dev/null +++ b/internal/lookup/root/root_test.go @@ -0,0 +1,81 @@ +/** +# Copyright 2023 NVIDIA CORPORATION +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +**/ + +package root + +import ( + "path/filepath" + "testing" + + testlog "github.com/sirupsen/logrus/hooks/test" + "github.com/stretchr/testify/require" + + "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup" + "github.com/NVIDIA/nvidia-container-toolkit/internal/test" +) + +func TestDriverLibrariesLocate(t *testing.T) { + logger, _ := testlog.NewNullLogger() + + moduleRoot, err := test.GetModuleRoot() + require.NoError(t, err) + + testCases := []struct { + rootFs string + inputs []string + expected string + expectedError error + }{ + { + rootFs: "rootfs-empty", + inputs: []string{"libcuda.so.1", "libcuda.so.*", "libcuda.so.*.*", "libcuda.so.999.88.77"}, + expectedError: lookup.ErrNotFound, + }, + { + rootFs: "rootfs-no-cache-lib64", + inputs: []string{"libcuda.so.1", "libcuda.so.*", "libcuda.so.*.*", "libcuda.so.999.88.77"}, + expected: "/usr/lib64/libcuda.so.999.88.77", + }, + { + rootFs: "rootfs-1", + inputs: []string{"libcuda.so.1", "libcuda.so.*", "libcuda.so.*.*", "libcuda.so.999.88.77"}, + expected: "/lib/x86_64-linux-gnu/libcuda.so.999.88.77", + }, + { + rootFs: "rootfs-2", + inputs: []string{"libcuda.so.1", "libcuda.so.*", "libcuda.so.*.*", "libcuda.so.999.88.77"}, + expected: "/var/lib/nvidia/lib64/libcuda.so.999.88.77", + }, + } + + for _, tc := range testCases { + for _, input := range tc.inputs { + t.Run(tc.rootFs+input, func(t *testing.T) { + rootfs := filepath.Join(moduleRoot, "testdata", "lookup", tc.rootFs) + driver := New( + WithLogger(logger), + WithDriverRoot(rootfs), + ) + + candidates, err := driver.Libraries().Locate(input) + require.ErrorIs(t, err, tc.expectedError) + if tc.expectedError == nil { + require.Equal(t, []string{filepath.Join(rootfs, tc.expected)}, candidates) + } + }) + } + } +} diff --git a/testdata/go.mod b/testdata/go.mod new file mode 100644 index 00000000..e69de29b diff --git a/testdata/lookup/rootfs-1/README.md b/testdata/lookup/rootfs-1/README.md new file mode 100644 index 00000000..ba0c4a17 --- /dev/null +++ b/testdata/lookup/rootfs-1/README.md @@ -0,0 +1,2 @@ +This rootfs represents a host with the CUDA driver libraries installed in +/lib/x86_64-linux-gnu. The included /etc/ld.so.cache was copied from such as system. \ No newline at end of file diff --git a/testdata/lookup/rootfs-1/etc/ld.so.cache b/testdata/lookup/rootfs-1/etc/ld.so.cache new file mode 100644 index 0000000000000000000000000000000000000000..8ef99f3fd607c44a91cd51312c7316226f63fae4 GIT binary patch literal 57276 zcmbuI3Ah|Zx&8-&f`B`?T(02V++ae^2?+s2AP|EXkPyHK=&@&}XU=eD%k<32Nm#_V z0ix`SAP@=n5&>lq5J5IkK~|R_`{un8aUuS}4G3`G@2g(EuKBupa{ra5pPc#4`+ikj zU0q#Wy-cl9FO`dp%JiT;z3i38{gLS-Yd0?(z?0sEc8-}doBVLL1`QNDA*7Abr=*r^J? z8SDXtZ@i#TcncPpDE>}hdn?nm_4E8;RKLqv%g>SWgq44imWTJd`0ozyMM}XB7 zemvNjHs7pJxE|~$#5Y0EFj4$Rz}6DqSa5vY{D4B?omf&FakdAWP27s}F|dPeJ!E~b z<7|$sP6Jy-TqG*bU0@F?{3Wo>KOw~Ulk_vd_EdNkEKvAaV3#U<4cIdZf75}5!h5mE zMEULuwpiiEf}N)DAA;Sh@V|g-8b9k0^W`Y^lP(33j!@p8)%d!ryyPp)d!F z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n?8C?@Y2u$L4*xvbkLA%f{|ikPU2^~c literal 0 HcmV?d00001 diff --git a/testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.1 b/testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.1 new file mode 120000 index 00000000..b25100e4 --- /dev/null +++ b/testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.1 @@ -0,0 +1 @@ +libcuda.so.999.88.77 \ No newline at end of file diff --git a/testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.999.88.77 b/testdata/lookup/rootfs-1/lib/x86_64-linux-gnu/libcuda.so.999.88.77 new file mode 100644 index 00000000..e69de29b diff --git a/testdata/lookup/rootfs-2/README.md b/testdata/lookup/rootfs-2/README.md new file mode 100644 index 00000000..cf26d880 --- /dev/null +++ b/testdata/lookup/rootfs-2/README.md @@ -0,0 +1,3 @@ +This rootfs represents a host with the CUDA driver libraries installed in +/var/lib/nvidia/lib64. The included /etc/ld.so.cache was generated in a container +simulating such as system. \ No newline at end of file diff --git a/testdata/lookup/rootfs-2/etc/ld.so.cache b/testdata/lookup/rootfs-2/etc/ld.so.cache new file mode 100644 index 0000000000000000000000000000000000000000..5fdcf29fedeb2f4b74117a2742cc9f5db7b2a6d2 GIT binary patch literal 43425 zcmbt-3Ah|(mG(y>GCYjnGBPYG;ZbDKzRA5=47i1a5FnR?HCz&~Q(ax%w{m-_bXDJU z!j^@EkOX84O9+r4i9y9d{RJG55uIUCQ6I)ZluZV~`A0@jM+MRGe@|8Qy(gDb=c~+r zp67LW^Y;1n{rl=xYktWs)XF_!v&VJZL9e%`_pWiqJUeI%{>z+nC;o%k`0>V+E;Ht6 zfLoXE7x+IcGv-?WH_{XTbAi8jhB1QxH`1RT8uM|08}W|}81of?8}YNY7*hba5kIkP z%)tOR;vc=hn6Codi2wCEW1a%I5&wM4n8yHa#6P^rn7aXP#4lcL%qajj;;+2im=3^= z_#dw|=0SiP@gLk^%sT*X#Q)(sPF2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