github.com/terraform-modules-krish/terratest@v0.29.0/modules/ssh/key_pair_test.go (about)

     1  package ssh
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  // Basic test to ensure we can successfully generate key pairs (no explicit validation for now)
    10  func TestGenerateRSAKeyPair(t *testing.T) {
    11  	t.Parallel()
    12  
    13  	keyPair := GenerateRSAKeyPair(t, 2048)
    14  	assert.Contains(t, keyPair.PublicKey, "ssh-rsa")
    15  	assert.Contains(t, keyPair.PrivateKey, "-----BEGIN RSA PRIVATE KEY-----")
    16  }