-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some specs for OpenBSD operating system
- Loading branch information
1 parent
24a0c6e
commit be61fd4
Showing
4 changed files
with
101 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import OpenBsd from '../../../src/operating_systems/openbsd/openbsd' | ||
import hostModule from '../../../src/host' | ||
import * as arch from '../../../src/architecture' | ||
import * as os from '../../../src/operating_systems/kind' | ||
import {SshConfigurationKind} from '../../../src/action/action' | ||
import {Host} from '../../../src/host' | ||
|
||
let context = describe | ||
|
||
describe('OpenBSD OperatingSystem', () => { | ||
let osKind = os.Kind.for('openbsd') | ||
|
||
describe('actionImplementationKind', () => { | ||
context('when on a macOS host', () => { | ||
let host = Host.create('darwin') | ||
|
||
context('when the architecture is x86_64', () => { | ||
let architecture = arch.Architecture.for( | ||
arch.Kind.x86_64, | ||
host, | ||
osKind, | ||
host.hypervisor | ||
) | ||
let openbsd = new OpenBsd(architecture, '0.0.0') | ||
|
||
beforeEach(() => { | ||
spyOnProperty(hostModule, 'host').and.returnValue(host) | ||
}) | ||
|
||
it('returns the "xhyve" SSH config kind', () => { | ||
const result = openbsd.actionImplementationKind | ||
expect(result).toEqual(SshConfigurationKind.xhyve) | ||
}) | ||
}) | ||
|
||
context('when the architecture is not x86_64', () => { | ||
let architecture = arch.Architecture.for( | ||
arch.Kind.arm64, | ||
host, | ||
osKind, | ||
host.hypervisor | ||
) | ||
let openbsd = new OpenBsd(architecture, '0.0.0') | ||
|
||
beforeEach(() => { | ||
spyOnProperty(hostModule, 'host').and.returnValue(host) | ||
}) | ||
|
||
it('returns the "qemu" SSH config kind', () => { | ||
const result = openbsd.actionImplementationKind | ||
expect(result).toEqual(SshConfigurationKind.qemu) | ||
}) | ||
}) | ||
}) | ||
|
||
context('when on a Linux host', () => { | ||
let host = Host.create('linux') | ||
|
||
context('when the architecture is x86_64', () => { | ||
let architecture = arch.Architecture.for( | ||
arch.Kind.x86_64, | ||
host, | ||
osKind, | ||
host.hypervisor | ||
) | ||
let openbsd = new OpenBsd(architecture, '0.0.0') | ||
|
||
beforeEach(() => { | ||
spyOnProperty(hostModule, 'host').and.returnValue(host) | ||
}) | ||
|
||
it('returns the "qemu" SSH config kind', () => { | ||
const result = openbsd.actionImplementationKind | ||
expect(result).toEqual(SshConfigurationKind.qemu) | ||
}) | ||
}) | ||
|
||
context('when the architecture is not x86_64', () => { | ||
let architecture = arch.Architecture.for( | ||
arch.Kind.arm64, | ||
host, | ||
osKind, | ||
host.hypervisor | ||
) | ||
let openbsd = new OpenBsd(architecture, '0.0.0') | ||
|
||
beforeEach(() => { | ||
spyOnProperty(hostModule, 'host').and.returnValue(host) | ||
}) | ||
|
||
it('returns the "qemu" SSH config kind', () => { | ||
const result = openbsd.actionImplementationKind | ||
expect(result).toEqual(SshConfigurationKind.qemu) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters