Commit 88252d40 authored by Jeremiah Snapp's avatar Jeremiah Snapp
Browse files

Add Chef::Sugar::Architecture#aarch64?


Signed-off-by: default avatarJeremiah Snapp <jeremiah@chef.io>
parent 1c1164c0
......@@ -110,6 +110,17 @@ class Chef
.include?(node['kernel']['machine'])
end
#
# Determine if the current architecture is AArch64
#
# @return [Boolean]
#
def aarch64?(node)
# Add more arm variants as needed here
%w(aarch64)
.include?(node['kernel']['machine'])
end
#
# Determine if the current architecture is s390x
#
......@@ -149,6 +160,9 @@ class Chef
# @see Chef::Sugar::Architecture#arm?
def armhf?; Chef::Sugar::Architecture.armhf?(node); end
# @see Chef::Sugar::Architecture#aarch64?
def aarch64?; Chef::Sugar::Architecture.aarch64?(node); end
# @see Chef::Sugar::Architecture#s390x?
def s390x?; Chef::Sugar::Architecture.s390x?(node); end
......
......@@ -86,6 +86,14 @@ describe Chef::Sugar::Architecture do
end
end
describe '#aarch64?' do
it 'returns true when the system is AArch64' do
node = { 'kernel' => { 'machine' => 'aarch64' } }
expect(described_class.intel?(node)).to be false
expect(described_class.aarch64?(node)).to be true
end
end
describe '#sparc?' do
it 'returns true when the system is SPARC sun4u' do
node = { 'kernel' => { 'machine' => 'sun4u' } }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment