Skip to content

Commit

Permalink
test(system): linux version tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Sep 9, 2023
1 parent ee86699 commit 72c4286
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/system/env/info_centos6/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports =
os:
arch: 'x86_64'
distribution: 'centos'
linux_version: /5\.10\.\d+/
# linux_version: /5\.10\.\d+/
version: '6.10'
config: [
label: 'remote'
Expand Down
2 changes: 1 addition & 1 deletion packages/system/env/info_centos7/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports =
os:
arch: /x86_64|aarch64/
distribution: 'centos'
linux_version: /5\.10\.\d+/
# linux_version: /5\.10\.\d+/
version: /7\.9\.\d+/
config: [
label: 'local'
Expand Down
2 changes: 1 addition & 1 deletion packages/system/env/info_ubuntu/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports =
os:
arch: /x86_64|aarch64/
distribution: 'ubuntu'
linux_version: /5\.10\.\d+/
# linux_version: /5\.10\.\d+/
version: '20.04'
config: [
label: 'local'
Expand Down
4 changes: 2 additions & 2 deletions packages/system/env/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

cd `pwd`/`dirname ${BASH_SOURCE}`

npx coffee ./authconfig/index.coffee run
npx coffee ./cgroups/index.coffee run
# Require cgroup v1
# npx coffee ./env/cgroups/index.coffee run
./info_archlinux/run.sh
./info_centos6/run.sh
./info_centos7/run.sh
Expand Down
16 changes: 10 additions & 6 deletions packages/system/test/info/os.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ return unless tags.system_info_os
describe 'system.info.os', ->

they 'default options', ({ssh}) ->
{os} = await nikita($ssh: ssh).system.info.os()
Object.keys(os).sort().should.eql [
'arch', 'distribution', 'linux_version', 'version'
]
Object.keys(os).sort().should.eql Object.keys(expect.os)
os.should.match expect.os
nikita
$ssh: ssh
, ->
{stdout: expect.os.linux_version} = await @execute 'uname -r', trim: true unless expect.os.linux_version
{os} = await @system.info.os()
Object.keys(os).sort().should.eql [
'arch', 'distribution', 'linux_version', 'version'
]
Object.keys(os).sort().should.eql Object.keys(expect.os).sort()
os.should.match expect.os

0 comments on commit 72c4286

Please sign in to comment.