mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Vault SSH: Refactoring and fixes
This commit is contained in:
@@ -55,6 +55,8 @@ var testPort string
|
||||
var testUserName string
|
||||
var testAdminUser string
|
||||
|
||||
// Starts the server and initializes the servers IP address,
|
||||
// port and usernames to be used by the test cases.
|
||||
func init() {
|
||||
addr, err := vault.StartTestServer()
|
||||
if err != nil {
|
||||
@@ -83,6 +85,29 @@ func TestSSHBackend(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func testNamedKeys(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
Path: fmt.Sprintf("keys/%s", testKey),
|
||||
Data: map[string]interface{}{
|
||||
"key": testSharedPrivateKey,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func testNewRole(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
Path: fmt.Sprintf("roles/%s", testRoleName),
|
||||
Data: map[string]interface{}{
|
||||
"key": testKey,
|
||||
"admin_user": testAdminUser,
|
||||
"cidr": testCidr,
|
||||
"port": testPort,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func testRoleCreate(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
@@ -110,26 +135,3 @@ func testRoleCreate(t *testing.T) logicaltest.TestStep {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func testNewRole(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
Path: fmt.Sprintf("roles/%s", testRoleName),
|
||||
Data: map[string]interface{}{
|
||||
"key": testKey,
|
||||
"admin_user": testAdminUser,
|
||||
"cidr": testCidr,
|
||||
"port": testPort,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func testNamedKeys(t *testing.T) logicaltest.TestStep {
|
||||
return logicaltest.TestStep{
|
||||
Operation: logical.WriteOperation,
|
||||
Path: fmt.Sprintf("keys/%s", testKey),
|
||||
Data: map[string]interface{}{
|
||||
"key": testSharedPrivateKey,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user