github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/test/regression/release/byfn_release_tests.py (about)

     1  # Copyright IBM Corp. All Rights Reserved.
     2  #
     3  # SPDX-License-Identifier: Apache-2.0
     4  #
     5  
     6  import unittest
     7  import subprocess
     8  
     9  class byfn_cli_release_tests(unittest.TestCase):
    10  
    11      def test_byfn_cli_default_channel(self):
    12          '''
    13           In this cli test, we execute the byfn_cli tests on published release
    14           docker images and pull published fabric binaries and perform tests on
    15           fabric-samples repository.
    16  
    17           Passing criteria: byfn_cli test completed successfully with
    18           exit code 0
    19          '''
    20          logfile = open("output_byfn_cli_default_channel.log", "w")
    21          returncode = subprocess.call(
    22                  "./run_byfn_cli_release_tests.sh",
    23                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    24          logfile.close()
    25          self.assertEqual(returncode, 0, msg="test_byfn_cli_default_channel "
    26                  "tests are failed. \nPlease check the logfile "
    27                  +logfile.name+" for more details.")
    28  
    29      def test_byfn_cli_custom_channel(self):
    30          '''
    31           In this cli test, we execute the byfn_cli tests on published release
    32           docker images and pull published fabric binaries and perform tests on
    33           fabric-samples repository.
    34  
    35           Passing criteria: test_byfn_cli_custom_channel test completed successfully with
    36           exit code 0
    37          '''
    38          logfile = open("output_byfn_cli_custom_channel.log", "w")
    39          returncode = subprocess.call(
    40                  "././run_byfn_cli_release_tests.sh byfnchannel",
    41                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    42          logfile.close()
    43          self.assertEqual(returncode, 0, msg="test_byfn_cli_custom_channel "
    44                  "tests are failed. \nPlease check the logfile "
    45                  +logfile.name+" for more details.")
    46  
    47      def test_node_sdk_byfn(self):
    48          '''
    49           In this node_sdk_byfn test, we pull published docker images from
    50           docker hub account and verify integration tests.
    51  
    52           Passing criteria: Underlying node_sdk byfn tests are completed successfully
    53           with exit code 0
    54          '''
    55          logfile = open("output_node_sdk_byfn.log", "w")
    56          returncode = subprocess.call(
    57                  "./run_node_sdk_byfn.sh",
    58                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    59          logfile.close()
    60          self.assertEqual(returncode, 0, msg="node_sdk_byfn test"
    61                  " failed. \nPlease check the logfile "+logfile.name+" for more "
    62                  "details.")