@@ -44,6 +44,14 @@ describe('Given a function to get the default cluster user', () => {
4444 } )
4545 } )
4646
47+ describe ( 'when the OS is Ubuntu 18.04' , ( ) => {
48+ const cluster = { config : { Image : { Os : 'ubuntu1804' } } }
49+ it ( 'should be ubuntu' , ( ) => {
50+ const result = clusterDefaultUser ( cluster )
51+ expect ( result ) . toBe ( 'ubuntu' )
52+ } )
53+ } )
54+
4755 describe ( 'when the OS is Ubuntu 20.04' , ( ) => {
4856 const cluster = { config : { Image : { Os : 'ubuntu2004' } } }
4957 it ( 'should be ubuntu' , ( ) => {
@@ -67,4 +75,20 @@ describe('Given a function to get the default cluster user', () => {
6775 expect ( result ) . toBe ( 'centos' )
6876 } )
6977 } )
78+
79+ describe ( 'when the OS is Rhel 8' , ( ) => {
80+ const cluster = { config : { Image : { Os : 'rhel8' } } }
81+ it ( 'should be ec2-user' , ( ) => {
82+ const result = clusterDefaultUser ( cluster )
83+ expect ( result ) . toBe ( 'ec2-user' )
84+ } )
85+ } )
86+
87+ describe ( 'when the OS is Rhel 9' , ( ) => {
88+ const cluster = { config : { Image : { Os : 'rhel9' } } }
89+ it ( 'should be ec2-user' , ( ) => {
90+ const result = clusterDefaultUser ( cluster )
91+ expect ( result ) . toBe ( 'ec2-user' )
92+ } )
93+ } )
7094} )
0 commit comments