Skip to content

Commit ead9ac7

Browse files
integration tests: add a test case for share access via service
Use the in-cluster dns to access a share by the name of the service that gets created by the operator. Signed-off-by: John Mulligan <jmulligan@redhat.com>
1 parent 1012a31 commit ead9ac7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/integration/smb_share_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (s *SmbShareSuite) TestPodsReady() {
9696
s.Require().NoError(s.waitForPodReady())
9797
}
9898

99-
func (s *SmbShareSuite) TestShareAccess() {
99+
func (s *SmbShareSuite) TestShareAccessByIP() {
100100
ip, err := s.getPodIP()
101101
s.Require().NoError(err)
102102
shareAccessSuite := &ShareAccessSuite{
@@ -109,6 +109,20 @@ func (s *SmbShareSuite) TestShareAccess() {
109109
suite.Run(s.T(), shareAccessSuite)
110110
}
111111

112+
func (s *SmbShareSuite) TestShareAccessByServiceName() {
113+
svcname := fmt.Sprintf("%s.%s.svc.cluster.local",
114+
s.smbShareResourceName,
115+
testNamespace)
116+
shareAccessSuite := &ShareAccessSuite{
117+
share: smbclient.Share{
118+
Host: smbclient.Host(svcname),
119+
Name: s.shareName,
120+
},
121+
auths: s.testAuths,
122+
}
123+
suite.Run(s.T(), shareAccessSuite)
124+
}
125+
112126
func TestSmbShares(t *testing.T) {
113127
t.Run("1", func(t *testing.T) {
114128
smbShareSuite1 := &SmbShareSuite{

0 commit comments

Comments
 (0)