You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by achristianson <gi...@git.apache.org> on 2017/09/12 17:55:45 UTC

[GitHub] nifi-minifi-cpp pull request #135: MINIFI-374 Created automated tests for HT...

GitHub user achristianson opened a pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/135

    MINIFI-374 Created automated tests for HTTPS integration cases

    Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced
         in the commit message?
    
    - [x] Does your PR title start with MINIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
    - [x] If applicable, have you updated the LICENSE file?
    - [x] If applicable, have you updated the NOTICE file?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/achristianson/nifi-minifi-cpp MINIFI-374

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi-minifi-cpp/pull/135.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #135
    
----
commit d5d5437c7512f04f5475482e049912ca9772ed9e
Author: Andrew I. Christianson <an...@andyic.org>
Date:   2017-08-18T15:13:35Z

    MINIFI-374 Created automated tests for HTTPS integration cases

----


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    This now gets me past the point where the venv couldn't be created, but seem to be having issues with the running of the tests themselves.
    ```
     DEBUG:urllib3.connectionpool:http://localhost:None "DELETE /v1.30/networks/9edfa045d1a03039cbf5ee1a1b7622f808d7d31bc3335b637e48726387dddd99 HTTP/1.1" 204 0
    FAILED
    ../docker/test/integration/test_https.py::test_invoke_listen_https_one_way INFO:root:Generating test certificate request
    ...
    FAILED
    
    ========================================================================================================================================================== FAILURES ==========================================================================================================================================================
    _____________________________________________________________________________________________________________________________________________________ test_invoke_listen _____________________________________________________________________________________________________________________________________________________
    
        def test_invoke_listen():
            """
            Verify sending using InvokeHTTP to a receiver using ListenHTTP.
            """
    
            invoke_flow = (GetFile('/tmp/input') >> LogAttribute() >>
                           InvokeHTTP('http://minifi-listen:8080/contentListener', method='POST'))
    
            listen_flow = ListenHTTP(8080) >> LogAttribute() >> PutFile('/tmp/output')
    
            with DockerTestCluster(SingleFileOutputValidator('test')) as cluster:
    
                cluster.put_test_data('test')
                cluster.deploy_flow(listen_flow, name='minifi-listen')
                cluster.deploy_flow(invoke_flow, name='minifi-invoke')
    
    >           assert cluster.check_output()
    E           assert False
    E            +  where False = <bound method DockerTestCluster.check_output of <minifi.test.DockerTestCluster object at 0x106491710>>()
    E            +    where <bound method DockerTestCluster.check_output of <minifi.test.DockerTestCluster object at 0x106491710>> = <minifi.test.DockerTestCluster object at 0x106491710>.check_output
    
    ../docker/test/integration/test_http.py:36: AssertionError
    ______________________________________________________________________________________________________________________________________________ test_invoke_listen_https_one_way ______________________________________________________________________________________________________________________________________________
    
        def test_invoke_listen_https_one_way():
            """
            Verify sending using InvokeHTTP to a receiver using ListenHTTP (with TLS).
            """
    
            cert, key = gen_cert()
    
            # TODO define SSLContextService class & generate config yml for services
            crt_file = '/tmp/resources/test-crt.pem'
    
            invoke_flow = (GetFile('/tmp/input')
                           >> LogAttribute()
                           >> InvokeHTTP('https://minifi-listen:4430/contentListener',
                                         method='POST',
                                         ssl_context_service=SSLContextService(ca_cert=crt_file)))
    
            listen_flow = (ListenHTTP(4430, cert=crt_file)
                           >> LogAttribute()
                           >> PutFile('/tmp/output'))
    
            with DockerTestCluster(SingleFileOutputValidator('test')) as cluster:
                cluster.put_test_resource('test-crt.pem', cert.as_pem() + key.as_pem(None, callback))
                cluster.put_test_data('test')
                cluster.deploy_flow(listen_flow, name='minifi-listen')
                cluster.deploy_flow(invoke_flow, name='minifi-invoke')
    
    >           assert cluster.check_output()
    E           assert False
    E            +  where False = <bound method DockerTestCluster.check_output of <minifi.test.DockerTestCluster object at 0x1065481d0>>()
    E            +    where <bound method DockerTestCluster.check_output of <minifi.test.DockerTestCluster object at 0x1065481d0>> = <minifi.test.DockerTestCluster object at 0x1065481d0>.check_output
    
    ../docker/test/integration/test_https.py:54: AssertionError
    ============================================================================================================================================ 2 failed, 2 passed in 36.37 seconds =============================================================================================================================================
    make[3]: *** [CMakeFiles/docker-verify] Error 1
    make[2]: *** [CMakeFiles/docker-verify.dir/all] Error 2
    make[1]: *** [CMakeFiles/docker-verify.dir/rule] Error 2
    make: *** [docker-verify] Error 2
    ```
    
    Of note, and not sure if this is a contributing factor.  I did rebuild the image.  When I first evaluated, I believe it was using a cached version of the minifi-cpp built from another branch.  This isn't necessarily bad, but may be worthwhile to force a new image build with the current sources for this particular target to ensure we are testing the latest items.


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    reviewing


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    This PR depends on the phrocker/MINIFI-339 branch. Once that's merged, everything will pass. In the meantime, this commit can be applied on top of that branch to test.


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    Understood.  Was able to verify correctness off of that branch.  Will merge this in, thanks!


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    @achristianson Must have gotten mixed up on branches or repos, but seem to be getting an error on the build due to m2crypto.
    
    > Failed building wheel for m2crypto
    >   Running setup.py clean for m2crypto
    > Failed to build m2crypto
    > Installing collected packages: m2crypto, pathtools, argh, watchdog
    >   Running setup.py install for m2crypto ... error
    >     Complete output from command /Users/apiri/Development/code/apache/nifi-minifi-cpp/build/test-env-py2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7s/6sbtw9n10q50rdttrsd5dwq00000gn/T/pip-build-CZHOP7/m2crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/7s/6sbtw9n10q50rdttrsd5dwq00000gn/T/pip-vqOR3N-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apiri/Development/code/apache/nifi-minifi-cpp/build/test-env-py2/bin/../include/site/python2.7/m2crypto:
    
    I was able to workaround it using largely the process outlined here; https://stackoverflow.com/a/33125400/231008 with the addition of doing a sudo pip install of m2crypto.  
    
    Let me know if I'm overlooking something.  Thanks!


---

[GitHub] nifi-minifi-cpp pull request #135: MINIFI-374 Created automated tests for HT...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi-minifi-cpp/pull/135


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    changes look good, will merge


---

[GitHub] nifi-minifi-cpp issue #135: MINIFI-374 Created automated tests for HTTPS int...

Posted by achristianson <gi...@git.apache.org>.
Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/135
  
    @apiri I just added a check in the verify script for openssl in homebrew. If brew is available & openssl is installed by it, it will automatically add the required CFLAGS/LDFLAGS. Please give it another go and see if this fixes the issue.


---