mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #4257 from sohankunkerkar/release-1.1
[1.1] libcontainer: force apps to think fips is enabled/disabled for testing
This commit is contained in:
@@ -602,6 +602,7 @@ func checkProcMount(rootfs, dest, source string) error {
|
||||
"/proc/slabinfo",
|
||||
"/proc/net/dev",
|
||||
"/proc/sys/kernel/ns_last_pid",
|
||||
"/proc/sys/crypto/fips_enabled",
|
||||
}
|
||||
for _, valid := range validProcMounts {
|
||||
path, err := filepath.Rel(filepath.Join(rootfs, valid), dest)
|
||||
|
||||
@@ -46,6 +46,14 @@ func TestCheckMountDestNsLastPid(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckCryptoFipsEnabled(t *testing.T) {
|
||||
dest := "/rootfs/proc/sys/crypto/fips_enabled"
|
||||
err := checkProcMount("/rootfs", dest, "/proc")
|
||||
if err != nil {
|
||||
t.Fatalf("/proc/sys/crypto/fips_enabled should not return an error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDev(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
|
||||
Reference in New Issue
Block a user