Skip to content

Commit 9503b6f

Browse files
committed
Add deafault user tests for rhel8 and rhel9
Signed-off-by: Judy Ng <njud@amazon.com>
1 parent dec7e27 commit 9503b6f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

frontend/src/__tests__/util.test.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)