2017-04-04 00:24:53 +02:00
|
|
|
package opc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccOPCSecurityProtocol_importBasic(t *testing.T) {
|
|
|
|
resourceName := "opc_compute_security_protocol.test"
|
|
|
|
|
|
|
|
ri := acctest.RandInt()
|
|
|
|
config := fmt.Sprintf(testAccOPCSecurityProtocolBasic, ri)
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() {
|
|
|
|
testAccPreCheck(t)
|
|
|
|
},
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckSecurityProtocolDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
|
|
|
Config: config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
2017-04-10 13:22:16 +02:00
|
|
|
func TestAccOPCSecurityProtocol_importComplete(t *testing.T) {
|
2017-04-04 00:24:53 +02:00
|
|
|
resourceName := "opc_compute_security_protocol.test"
|
|
|
|
|
|
|
|
ri := acctest.RandInt()
|
2017-04-10 13:22:16 +02:00
|
|
|
config := fmt.Sprintf(testAccOPCSecurityProtocolComplete, ri)
|
2017-04-04 00:24:53 +02:00
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() {
|
|
|
|
testAccPreCheck(t)
|
|
|
|
},
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckSecurityProtocolDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
{
|
|
|
|
Config: config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|