<commit_before>include:
  - control-node.repos

ssh-private-key:
  file.managed:
    - name: /root/.ssh/id_rsa
    - source: salt://control-node/id_rsa
    - makedirs: True
    - user: root
    - group: root
    - mode: 700

ssh-public-key:
  file.managed:
    - name: /root/.ssh/id_rsa.pub
    - source: salt://control-node/id_rsa.pub
    - makedirs: True
    - user: root
    - group: root
    - mode: 700

authorized-keys-control-node:
  file.append:
    - name: /root/.ssh/authorized_keys
    - source: salt://control-node/id_rsa.pub
    - makedirs: True

virtualhost:
  file.managed:
    - name: /tmp/virtualhostmanager.create.json
    - source: salt://control-node/virtualhostmanager.create.json

cucumber-requisites:
  pkg.installed:
    - pkgs:
      - gcc
      - make
      - ruby
      - ruby-devel
      - firefox-bin
      - apache2-worker
      - phantomjs
      - owasp-zap
      - mozilla-nss
      - git-core
      - wget
      - aaa_base-extras
      - unzip
      # packaged ruby gems
      - ruby2.1-rubygem-bundler
      - rubygem-cucumber
      - twopence
      - rubygem-rack-1_2
      - rubygem-selenium-webdriver
      - rubygem-net-ssh
      - rubygem-websocket-1_0
      - rubygem-websocket-driver
      - ruby2.1-rubygem-jwt
      - rubygem-mime-types
      - ruby2.1-rubygem-builder
      - rubygem-owasp_zap
      - rubygem-cliver
      - ruby2.1-rubygem-rake
      - rubygem-twopence
      - rubygem-lavanda
      - ruby2.1-rubygem-poltergeist
      - ruby2.1-rubygem-rake
    - require:
      - sls: control-node.repos

cucumber-testsuite:
  cmd.run:
    # HACK: work around the lack of skip_verify and enforce_toplevel in archive.extracted before salt 2016.11
    - name: |
        wget -P /root/ https://github.com/SUSE/spacewalk-testsuite-base/archive/{{ grains.get("branch" )}}.zip
        unzip /root/{{ grains.get("branch" )}}.zip -d /root/
        mv /root/spacewalk-testsuite-base-{{ grains.get("branch" )}} /root/spacewalk-testsuite-base
    - creates: /root/spacewalk-testsuite-base

cucumber-run-script:
  file.managed:
    - name: /usr/bin/run-testsuite
    - source: salt://control-node/run-testsuite.sh
    - template: jinja
    - user: root
    - group: root
    - mode: 755
<commit_msg>Add gem for codecoverage ruby<commit_after>include:
  - control-node.repos

ssh-private-key:
  file.managed:
    - name: /root/.ssh/id_rsa
    - source: salt://control-node/id_rsa
    - makedirs: True
    - user: root
    - group: root
    - mode: 700

ssh-public-key:
  file.managed:
    - name: /root/.ssh/id_rsa.pub
    - source: salt://control-node/id_rsa.pub
    - makedirs: True
    - user: root
    - group: root
    - mode: 700

authorized-keys-control-node:
  file.append:
    - name: /root/.ssh/authorized_keys
    - source: salt://control-node/id_rsa.pub
    - makedirs: True

virtualhost:
  file.managed:
    - name: /tmp/virtualhostmanager.create.json
    - source: salt://control-node/virtualhostmanager.create.json

cucumber-requisites:
  pkg.installed:
    - pkgs:
      - gcc
      - make
      - ruby
      - ruby-devel
      - firefox-bin
      - apache2-worker
      - phantomjs
      - owasp-zap
      - mozilla-nss
      - git-core
      - wget
      - aaa_base-extras
      - unzip
      # packaged ruby gems
      - ruby2.1-rubygem-bundler
      - rubygem-cucumber
      - twopence
      - rubygem-rack-1_2
      - rubygem-selenium-webdriver
      - rubygem-net-ssh
      - rubygem-websocket-1_0
      - rubygem-websocket-driver
      - ruby2.1-rubygem-jwt
      - rubygem-mime-types
      - ruby2.1-rubygem-builder
      - rubygem-owasp_zap
      - rubygem-cliver
      - ruby2.1-rubygem-rake
      - rubygem-twopence
      - ruby2.1-rubygem-simplecov
      - rubygem-lavanda
      - ruby2.1-rubygem-poltergeist
      - ruby2.1-rubygem-rake
    - require:
      - sls: control-node.repos

cucumber-testsuite:
  cmd.run:
    # HACK: work around the lack of skip_verify and enforce_toplevel in archive.extracted before salt 2016.11
    - name: |
        wget -P /root/ https://github.com/SUSE/spacewalk-testsuite-base/archive/{{ grains.get("branch" )}}.zip
        unzip /root/{{ grains.get("branch" )}}.zip -d /root/
        mv /root/spacewalk-testsuite-base-{{ grains.get("branch" )}} /root/spacewalk-testsuite-base
    - creates: /root/spacewalk-testsuite-base

cucumber-run-script:
  file.managed:
    - name: /usr/bin/run-testsuite
    - source: salt://control-node/run-testsuite.sh
    - template: jinja
    - user: root
    - group: root
    - mode: 755

{'fraction_non_alphanumeric': 0.12837538733953077, 'fraction_numerical': 0.014608233731739707, 'mean_word_length': 1.9325113562621674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7289744', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1660, 'n_words': 271}