Skip to content

Commit

Permalink
ipv4 regex for this also
Browse files Browse the repository at this point in the history
  • Loading branch information
ljblancoredborder committed Apr 24, 2024
1 parent 38b6844 commit ba7a624
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/configuration/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
describe 'Sync network' do
sync = command('ip addr show').stdout
it 'Have a network sync' do
interfaces_with_ip = sync.scan(/inet\s+(\d+\.\d+\.\d+\.\d+)/).flatten
interfaces_with_ip = sync.scan(/inet\s+(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/).flatten
expect(interfaces_with_ip.length).to be >= 3
puts "OUTPUT: #{interfaces_with_ip}"
end
Expand Down

0 comments on commit ba7a624

Please sign in to comment.