<commit_before>require 'spec_helper'

# Test to ensure images are not vulnerable to CVE-2015-7547
# See:
# https://googleonlinesecurity.blogspot.ca/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7547

# ubuntu-16.04
if property[:name] =~ /Ubuntu 16.04/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.23-0ubuntu3') }
  end
end

# ubuntu-15.10
if property[:name] =~ /Ubuntu 15.10/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.21-0ubuntu4.1') }
  end
end


# ubuntu-14.04
if property[:name] =~ /Ubuntu 14.04/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.19-0ubuntu6.9') }
  end
end

if property[:name] =~ /Node\.js/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.19-0ubuntu6.9') }
  end
end

# CentOS 6
if property[:name] =~ /CentOS 6./
  describe command('rpm -q --info glibc') do
    its(:stdout) { should contain('2.12') }
    its(:stdout) { should contain('1.192.el6') }
  end
end

# CentOS 7
if property[:name] =~ /CentOS 7./
  describe command('rpm -q --info glibc') do
    its(:stdout) { should contain('2.17') }
    its(:stdout) { should contain('106.el7_2.8') }
  end
end

# Debian 7
if property[:name] =~ /Debian 7./
  describe command('ldd --version') do
    its(:stdout) { should match /2.13-38\+deb7u11/ }
  end
end

# Debian 8
if property[:name] =~ /Debian 8./
  describe command('ldd --version') do
    its(:stdout) { should match /2.19-18\+deb8u6/ }
  end
end<commit_msg>bump version for glibc test<commit_after>require 'spec_helper'

# Test to ensure images are not vulnerable to CVE-2015-7547
# See:
# https://googleonlinesecurity.blogspot.ca/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7547

# ubuntu-16.04
if property[:name] =~ /Ubuntu 16.04/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.23-0ubuntu3') }
  end
end

# ubuntu-15.10
if property[:name] =~ /Ubuntu 15.10/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.21-0ubuntu4.1') }
  end
end


# ubuntu-14.04
if property[:name] =~ /Ubuntu 14.04/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.19-0ubuntu6.9') }
  end
end

if property[:name] =~ /Node\.js/
  describe command('ldd --version') do
    its(:stdout) { should contain('2.19-0ubuntu6.9') }
  end
end

# CentOS 6
if property[:name] =~ /CentOS 6./
  describe command('rpm -q --info glibc') do
    its(:stdout) { should contain('2.12') }
    its(:stdout) { should contain('1.192.el6') }
  end
end

# CentOS 7
if property[:name] =~ /CentOS 7./
  describe command('rpm -q --info glibc') do
    its(:stdout) { should contain('2.17') }
    its(:stdout) { should contain('157.el7_3.1') }
  end
end

# Debian 7
if property[:name] =~ /Debian 7./
  describe command('ldd --version') do
    its(:stdout) { should match /2.13-38\+deb7u11/ }
  end
end

# Debian 8
if property[:name] =~ /Debian 8./
  describe command('ldd --version') do
    its(:stdout) { should match /2.19-18\+deb8u6/ }
  end
end
{'fraction_non_alphanumeric': 0.17673235855054037, 'fraction_numerical': 0.0743801652892562, 'mean_word_length': 3.328748280605227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '397840', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1183, 'n_words': 283}