mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-06 14:07:50 +00:00
Implements the feature introduced in the design
document added with commit 4bdc1d37
Fixes https://redhat.atlassian.net/browse/RUN-4260
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
26 lines
566 B
Go
26 lines
566 B
Go
package certificates
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func verifyCertificateFile(_ string) error {
|
|
return nil
|
|
}
|
|
|
|
func TestExtractAndSaveCertificates(t *testing.T) {
|
|
certs := extractHostCertificates()
|
|
// On Linux extractHostCertificates is not implemented
|
|
// therefore `certs` is expected to be empty.
|
|
assert.Empty(t, certs)
|
|
|
|
filePath := filepath.Join(t.TempDir(), "cert.pem")
|
|
err := saveCertificatesToPEM(certs, filePath)
|
|
assert.NoError(t, err)
|
|
|
|
err = verifyCertificateFile(filePath)
|
|
assert.NoError(t, err)
|
|
}
|