<commit_before>#!/usr/bin/env ruby
#
# This is a script that uses
# instructions here: http://swift.openstack.org/howto_installmultinode.html
# Even though I expect this script will work with a wide range
# of swift versions, it is currently only tested with: 1.4.6
require 'open3'
require 'fileutils'

# connection variables
proxy_local_net_ip='127.0.0.1'
user='openstack:admin'
password='<PASSWORD>'

# headers for curl requests
user_header="-H 'X-Storage-User: #{user}'"
password_header="-H 'X-Storage-Pass: #{password}'"
get_cred_command="curl -k -v #{user_header} #{password_header} http://#{proxy_local_net_ip}:5000/v2.0/"

# verify that we can retrive credentials from our user
result_hash = {}
puts "getting credentials: #{get_cred_command}"
Open3.popen3(get_cred_command) do |stdin, stdout, stderr|
  result_hash[:stderr] = stderr.read
  result_hash[:stderr].split("\n").each do |line|
    if line =~ /^< HTTP\/\d\.\d (\d\d\d)/
      result_hash[:status_code]=$1
    end
    if line =~ /< X-Storage-Url: (http\S+)/
      result_hash[:auth_url]=$1
    end
    if line =~ /< X-Storage-Token: (AUTH_\S+)/
      result_hash[:auth_token]=$1
    end
  end
end
raise(Exception, "Call to get auth tokens failed:\n#{result_hash[:stderr]}") unless result_hash[:status_code] == '200'

# verify that the credentials are valid
auth_token_header="-H 'X-Auth-Token: #{result_hash[:auth_token]}'"
puts auth_token_header
get_account_head="curl -k -v #{auth_token_header} #{result_hash[:auth_url]}"
# what is the expected code?
puts "verifying connection auth: #{get_account_head}"
Open3.popen3(get_account_head) do |stdin, stdout, stderr|
  #puts stdout.read
  #puts stderr.read
end


swift_command_prefix="swift -A http://#{proxy_local_net_ip}:5000/v2.0/ -V 2 -U #{user} -K #{password}"

swift_test_command="#{swift_command_prefix} stat"
<commit_msg>Remove invalid keystone test code<commit_after>#!/usr/bin/env ruby
#
# This is a script that uses
# instructions here: http://swift.openstack.org/howto_installmultinode.html
# Even though I expect this script will work with a wide range
# of swift versions, it is currently only tested with: 1.4.6
require 'open3'
require 'fileutils'

# connection variables
proxy_local_net_ip='127.0.0.1'
user='openstack:admin'
password='<PASSWORD>'

## headers for curl requests
#user_header="-H 'X-Storage-User: #{user}'"
#password_header="-H 'X-Storage-Pass: #{password}'"
#get_cred_command="curl -k -v #{user_header} #{password_header} http://#{proxy_local_net_ip}:5000/v2.0/"
#
## verify that we can retrive credentials from our user
#result_hash = {}
#puts "getting credentials: #{get_cred_command}"
#Open3.popen3(get_cred_command) do |stdin, stdout, stderr|
#  result_hash[:stderr] = stderr.read
#  result_hash[:stderr].split("\n").each do |line|
#    if line =~ /^< HTTP\/\d\.\d (\d\d\d)/
#      result_hash[:status_code]=$1
#    end
#    if line =~ /< X-Storage-Url: (http\S+)/
#      result_hash[:auth_url]=$1
#    end
#    if line =~ /< X-Storage-Token: (AUTH_\S+)/
#      result_hash[:auth_token]=$1
#    end
#  end
#end
#raise(Exception, "Call to get auth tokens failed:\n#{result_hash[:stderr]}") unless result_hash[:status_code] == '200'
#
## verify that the credentials are valid
#auth_token_header="-H 'X-Auth-Token: #{result_hash[:auth_token]}'"
#puts auth_token_header
#get_account_head="curl -k -v #{auth_token_header} #{result_hash[:auth_url]}"
## what is the expected code?
#puts "verifying connection auth: #{get_account_head}"
#Open3.popen3(get_account_head) do |stdin, stdout, stderr|
#  #puts stdout.read
#  #puts stderr.read
#end


swift_command_prefix="swift -A http://#{proxy_local_net_ip}:5000/v2.0/ -V 2 -U #{user} -K #{password}"

swift_test_command="#{swift_command_prefix} stat"

{'fraction_non_alphanumeric': 0.15828877005347594, 'fraction_numerical': 0.01764705882352941, 'mean_word_length': 5.004815409309791, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '367311', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1335, 'n_words': 322}