github.com/darrenli6/fabric-sdk-example@v0.0.0-20220109053535-94b13b56df8c/test/regression/release/make_targets_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 make_targets(unittest.TestCase):
    10  
    11  
    12      def test_makeNative(self):
    13          '''
    14           In this make targets test, we execute makeNative target to make sure native target
    15           is working without any issues.
    16  
    17           Passing criteria: make native test completed successfully with
    18           exit code 0
    19          '''
    20          logfile = open("output_make_native_release_tests.log", "w")
    21          returncode = subprocess.call(
    22                  "./run_make_targets.sh makeNative",
    23                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    24          logfile.close()
    25          self.assertEqual(returncode, 0, msg="Run make native targets "
    26                  "make native target tests failed. \nPlease check the logfile ")
    27  
    28  
    29      def test_makeBinary(self):
    30          '''
    31           In this make targets test, we execute make binary target to make sure binary target
    32           is working without any issues.
    33  
    34           Passing criteria: make binary test completed successfully with
    35           exit code 0
    36          '''
    37          logfile = open("output_make_binary_release_tests.log", "w")
    38          returncode = subprocess.call(
    39                  "./run_make_targets.sh makeBinary",
    40                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    41          logfile.close()
    42          self.assertEqual(returncode, 0, msg="Run make binary target "
    43                  "make binary target tests failed. \nPlease check the logfile ")
    44  
    45  
    46      def test_makeDistAll(self):
    47          '''
    48           In this make targets test, we execute make dist-all target to make sure dist-all target
    49           is working without any issues.
    50  
    51           Passing criteria: make dist-all test completed successfully with
    52           exit code 0
    53          '''
    54          logfile = open("output_make_dist-all_release_tests.log", "w")
    55          returncode = subprocess.call(
    56                  "./run_make_targets.sh makeDistAll",
    57                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    58          logfile.close()
    59          self.assertEqual(returncode, 0, msg="Run make dist-all target "
    60                  "make dist-all target tests failed. \nPlease check the logfile ")
    61  
    62  
    63      def test_makeDocker(self):
    64          '''
    65           In this make targets test, we execute make docker target to make sure docker target
    66           is working without any issues.
    67  
    68           Passing criteria: make docker test completed successfully with
    69           exit code 0
    70          '''
    71          logfile = open("output_make_docker_release_tests.log", "w")
    72          returncode = subprocess.call(
    73                  "./run_make_targets.sh makeDocker",
    74                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    75          logfile.close()
    76          self.assertEqual(returncode, 0, msg="Run make Docker target "
    77                  "make Docker target tests failed. \nPlease check the logfile ")
    78  
    79      def test_makeVersion(self):
    80          '''
    81           In this make targets test, we execute version check to make sure binaries version
    82           is correct.
    83  
    84           Passing criteria: make version test completed successfully with
    85           exit code 0
    86          '''
    87          logfile = open("output_make_version_release_tests.log", "w")
    88          returncode = subprocess.call(
    89                  "./run_make_targets.sh makeVersion",
    90                  shell=True, stderr=subprocess.STDOUT, stdout=logfile)
    91          logfile.close()
    92          self.assertEqual(returncode, 0, msg="Run make version target "
    93                  "make version target tests failed. \nPlease check the logfile ")