@@ -65,7 +65,30 @@ func TestAccDataSourceNsxtPolicyContextProfile_multitenancy(t *testing.T) {
65
65
Providers : testAccProviders ,
66
66
Steps : []resource.TestStep {
67
67
{
68
- Config : testAccNsxtPolicyContextProfileMultitenancyTemplate (name ),
68
+ Config : testAccNsxtPolicyContextProfileMultitenancyTemplate (name , true ),
69
+ Check : resource .ComposeTestCheckFunc (
70
+ resource .TestCheckResourceAttr (testResourceName , "display_name" , name ),
71
+ resource .TestCheckResourceAttrSet (testResourceName , "description" ),
72
+ resource .TestCheckResourceAttrSet (testResourceName , "path" ),
73
+ ),
74
+ },
75
+ },
76
+ })
77
+ }
78
+
79
+ func TestAccDataSourceNsxtPolicyContextProfile_multitenancyProvider (t * testing.T ) {
80
+ name := getAccTestResourceName ()
81
+ testResourceName := "data.nsxt_policy_context_profile.test"
82
+
83
+ resource .ParallelTest (t , resource.TestCase {
84
+ PreCheck : func () {
85
+ testAccPreCheck (t )
86
+ testAccOnlyMultitenancy (t )
87
+ },
88
+ Providers : testAccProviders ,
89
+ Steps : []resource.TestStep {
90
+ {
91
+ Config : testAccNsxtPolicyContextProfileMultitenancyTemplate (name , false ),
69
92
Check : resource .ComposeTestCheckFunc (
70
93
resource .TestCheckResourceAttr (testResourceName , "display_name" , name ),
71
94
resource .TestCheckResourceAttrSet (testResourceName , "description" ),
@@ -83,8 +106,11 @@ data "nsxt_policy_context_profile" "test" {
83
106
}` , name )
84
107
}
85
108
86
- func testAccNsxtPolicyContextProfileMultitenancyTemplate (name string ) string {
87
- context := testAccNsxtPolicyMultitenancyContext ()
109
+ func testAccNsxtPolicyContextProfileMultitenancyTemplate (name string , withContext bool ) string {
110
+ context := ""
111
+ if withContext {
112
+ context = testAccNsxtPolicyMultitenancyContext ()
113
+ }
88
114
return fmt .Sprintf (`
89
115
resource "nsxt_policy_context_profile" "test" {
90
116
%s
0 commit comments