Skip to content

Commit

Permalink
Add deafault user tests for rhel8 and rhel9
Browse files Browse the repository at this point in the history
Signed-off-by: Judy Ng <[email protected]>
  • Loading branch information
judysng committed Feb 22, 2024
1 parent dec7e27 commit 9503b6f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions frontend/src/__tests__/util.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ describe('Given a function to get the default cluster user', () => {
})
})

describe('when the OS is Ubuntu 18.04', () => {
const cluster = {config: {Image: {Os: 'ubuntu1804'}}}
it('should be ubuntu', () => {
const result = clusterDefaultUser(cluster)
expect(result).toBe('ubuntu')
})
})

describe('when the OS is Ubuntu 20.04', () => {
const cluster = {config: {Image: {Os: 'ubuntu2004'}}}
it('should be ubuntu', () => {
Expand All @@ -67,4 +75,20 @@ describe('Given a function to get the default cluster user', () => {
expect(result).toBe('centos')
})
})

describe('when the OS is Rhel 8', () => {
const cluster = {config: {Image: {Os: 'rhel8'}}}
it('should be ec2-user', () => {
const result = clusterDefaultUser(cluster)
expect(result).toBe('ec2-user')
})
})

describe('when the OS is Rhel 9', () => {
const cluster = {config: {Image: {Os: 'rhel9'}}}
it('should be ec2-user', () => {
const result = clusterDefaultUser(cluster)
expect(result).toBe('ec2-user')
})
})
})

0 comments on commit 9503b6f

Please sign in to comment.