@@ -18,6 +18,7 @@ import (
1818func TestInstructions (t * testing.T ) {
1919 RHELYumISCSI := newRHELYumISCSI ()
2020 DebianAptISCSI := newDebianAptISCSI ()
21+ RHCOSISCSI := newRHCOSISCSI ()
2122 YumISCSI := newYumISCSI ()
2223 AptISCSI := newAptISCSI ()
2324
@@ -28,6 +29,7 @@ func TestInstructions(t *testing.T) {
2829 scopedInstructions := map [Key ]Instructions {}
2930 scopedInstructions [Key {Protocol : protocol .ISCSI , Distro : nodeinfo .DistroAmzn , PkgMgr : nodeinfo .PkgMgrYum }] = RHELYumISCSI
3031 scopedInstructions [Key {Protocol : protocol .ISCSI , Distro : nodeinfo .DistroUbuntu , PkgMgr : nodeinfo .PkgMgrApt }] = DebianAptISCSI
32+ scopedInstructions [Key {Protocol : protocol .ISCSI , Distro : nodeinfo .DistroRhel , PkgMgr : nodeinfo .PkgMgrNone }] = RHCOSISCSI
3133 scopedInstructions [Key {Protocol : protocol .ISCSI , Distro : "" , PkgMgr : nodeinfo .PkgMgrYum }] = YumISCSI
3234 scopedInstructions [Key {Protocol : protocol .ISCSI , Distro : "" , PkgMgr : nodeinfo .PkgMgrApt }] = AptISCSI
3335 ScopedInstructions (scopedInstructions )
@@ -54,6 +56,12 @@ func TestInstructions(t *testing.T) {
5456 },
5557 }
5658
59+ rhelHostSystemResponse := models.HostSystem {
60+ OS : models.SystemOS {
61+ Distro : nodeinfo .DistroRhel ,
62+ },
63+ }
64+
5765 const fooDistro nodeinfo.Distro = "foo"
5866
5967 fooHostSystemResponse := models.HostSystem {
@@ -124,6 +132,27 @@ func TestInstructions(t *testing.T) {
124132 setInstructions : setDefaultInstructions ,
125133 assertError : assert .NoError ,
126134 },
135+ "node info returns rhel distro without package manager" : {
136+ getOSClient : func (controller * gomock.Controller ) osutils.Utils {
137+ os := mock_osutils .NewMockUtils (controller )
138+ os .EXPECT ().GetHostSystemInfo (gomock .Any ()).Return (& rhelHostSystemResponse , nil )
139+ return os
140+ },
141+ getBinaryClient : func (controller * gomock.Controller ) nodeinfo.Binary {
142+ binary := mock_nodeinfo .NewMockBinary (controller )
143+ binary .EXPECT ().FindPath (nodeinfo .PkgMgrYum ).Return ("" )
144+ binary .EXPECT ().FindPath (nodeinfo .PkgMgrApt ).Return ("" )
145+ return binary
146+ },
147+ expectedNodeInfo : & nodeinfo.NodeInfo {
148+ PkgMgr : nodeinfo .PkgMgrNone ,
149+ HostSystem : rhelHostSystemResponse ,
150+ Distro : nodeinfo .DistroRhel ,
151+ },
152+ expectedInstructions : []Instructions {RHCOSISCSI },
153+ setInstructions : setDefaultInstructions ,
154+ assertError : assert .NoError ,
155+ },
127156 "node info returns unknown linux distro without package manager" : {
128157 getOSClient : func (controller * gomock.Controller ) osutils.Utils {
129158 os := mock_osutils .NewMockUtils (controller )
0 commit comments