You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/30 14:10:12 UTC

[jira] [Commented] (METRON-122) Create generic unit test framework for testing grok statements

    [ https://issues.apache.org/jira/browse/METRON-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15265297#comment-15265297 ] 

ASF GitHub Bot commented on METRON-122:
---------------------------------------

Github user dlyle65535 commented on the pull request:

    https://github.com/apache/incubator-metron/pull/96#issuecomment-215959703
  
    tl;dr I'm -1 on a small piece of this changeset, see below for why.
    
    Looking over this PR, it seems to be an aggregation of 4 JIRAs, METRON-122, METRON-91 (expose tags) and 2 new JIRAs, one for Bluecoat and 1 to fix the enrichment topology.
    
    It's a bummer because I'm +1 on everything but how exposing tags/skip_tags was handled. So although everything else looks great, I have to be -1 on the whole changeset.
    
    I'm -1 on that because it operates outside of the Vagrant paradigm and requires the user to enter the Vagrant password. Here's a more vagrantish solution:
    
    Add:
    ```
    require 'getoptlong'
    
    opts = GetoptLong.new(
      [ '--ansible-tags', GetoptLong::OPTIONAL_ARGUMENT ],
      [ '--ansible-skip-tags', GetoptLong::OPTIONAL_ARGUMENT ]
    )
    
    ansibleTags=''
    ansibleSkipTags=''
    
    opts.each do |opt, arg|
      case opt
        when '--ansible-tags'
          ansibleTags=arg
        when '--ansible-skip-tags'
          ansibleSkipTags=arg
      end
    end
    
    puts " Running with ansible-tags: " + ansibleTags.split(",").to_s if ansibleTags != ''
    puts " Running with ansible-skip-tags: " + ansibleSkipTags.split(",").to_s if ansibleSkipTags != ''
    ```
    To the top of the Vagrantfile (under the license).
    
    Then make the config loop look like this:
    
    ```
      # provisioning
      config.vm.provision :ansible do |ansible|
        ansible.playbook = "../../playbooks/metron_full_install.yml"
        ansible.sudo = true
        ansible.tags = ansibleTags.split(",") if ansibleTags != ''
        ansible.skip_tags = ansibleSkipTags.split(",") if ansibleSkipTags != ''
        ansible.inventory_path = "../../inventory/singlenode-vagrant"
      end
    ```
    
    That should (we'd have to test it) allow us to remove the new ansible.cfg unless you wanted to keep the custom control_path. You could also get rid of run_ansible_role.sh and run_enrichment_role.sh (it would be ``` vagrant --ansible-tags=enrichment provsion ``` )


> Create generic unit test framework for testing grok statements
> --------------------------------------------------------------
>
>                 Key: METRON-122
>                 URL: https://issues.apache.org/jira/browse/METRON-122
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)