/security/nss/tests/cmdtests/cmdtests.sh

http://github.com/zpao/v8monkey · Shell · 133 lines · 37 code · 16 blank · 80 comment · 5 complexity · a2f61e0e6eb8446db4eabbed177e12c0 MD5 · raw file

  1. #! /bin/sh
  2. #
  3. # ***** BEGIN LICENSE BLOCK *****
  4. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. #
  6. # The contents of this file are subject to the Mozilla Public License Version
  7. # 1.1 (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. # http://www.mozilla.org/MPL/
  10. #
  11. # Software distributed under the License is distributed on an "AS IS" basis,
  12. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. # for the specific language governing rights and limitations under the
  14. # License.
  15. #
  16. # The Original Code is the Netscape security libraries.
  17. #
  18. # The Initial Developer of the Original Code is
  19. # Netscape Communications Corporation.
  20. # Portions created by the Initial Developer are Copyright (C) 1994-2000
  21. # the Initial Developer. All Rights Reserved.
  22. #
  23. # Contributor(s):
  24. #
  25. # Alternatively, the contents of this file may be used under the terms of
  26. # either the GNU General Public License Version 2 or later (the "GPL"), or
  27. # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. # in which case the provisions of the GPL or the LGPL are applicable instead
  29. # of those above. If you wish to allow use of your version of this file only
  30. # under the terms of either the GPL or the LGPL, and not to allow others to
  31. # use your version of this file under the terms of the MPL, indicate your
  32. # decision by deleting the provisions above and replace them with the notice
  33. # and other provisions required by the GPL or the LGPL. If you do not delete
  34. # the provisions above, a recipient may use your version of this file under
  35. # the terms of any one of the MPL, the GPL or the LGPL.
  36. #
  37. # ***** END LICENSE BLOCK *****
  38. ########################################################################
  39. # Script to run small tests to test specific crashes of NSS
  40. #
  41. # needs to work on all Unix and Windows platforms
  42. #
  43. # included from
  44. # --------------
  45. # all.sh
  46. #
  47. # tests implemented:
  48. # vercrt (verify encryption cert - bugzilla bug 119059)
  49. # vercrtfps (verify encryption cert in fips mode - bugzilla bug 119214)
  50. # test3 (CERT_FindUserCertByUsage called 2nd time - bug 118864)
  51. #
  52. # special strings
  53. # ---------------
  54. #
  55. ########################################################################
  56. ############################## cmdtests_init ###########################
  57. # local shell function to initialize this script
  58. ########################################################################
  59. cmdtests_init()
  60. {
  61. SCRIPTNAME=cmdtests.sh # sourced - $0 would point to all.sh
  62. if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
  63. CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
  64. fi
  65. if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
  66. cd ../common
  67. . ./init.sh
  68. fi
  69. if [ ! -r $CERT_LOG_FILE ]; then # we need certificates here
  70. cd ../cert
  71. . ./cert.sh
  72. fi
  73. SCRIPTNAME=cmdtests.sh
  74. html_head "Tests in cmd/tests"
  75. # grep "SUCCESS: cmd/tests passed" $CERT_LOG_FILE >/dev/null || {
  76. # Exit 15 "Fatal - cert.sh needs to pass first"
  77. # }
  78. CMDTESTSDIR=${HOSTDIR}/cmd/tests
  79. COPYDIR=${CMDTESTSDIR}/copydir
  80. R_CMDTESTSDIR=../cmd/tests
  81. R_COPYDIR=../cmd/tests/copydir
  82. P_R_COPYDIR=${R_COPYDIR}
  83. if [ -n "${MULTIACCESS_DBM}" ]; then
  84. P_R_COPYDIR="multiaccess:Cmdtests.$version"
  85. fi
  86. mkdir -p ${CMDTESTSDIR}
  87. mkdir -p ${COPYDIR}
  88. mkdir -p ${CMDTESTSDIR}/html
  89. cd ${CMDTESTSDIR}
  90. }
  91. ############################## ct_vercrt ##################################
  92. # CERT_VerifyCert should not fail when verifying encryption cert
  93. # Bugzilla Bug 119059
  94. ########################################################################
  95. #ct_vercrt()
  96. #{
  97. # echo "$SCRIPTNAME: Verify encryption certificate ----------------------"
  98. # echo "vercrt"
  99. # vercrt
  100. # ret=$?
  101. # html_msg $ret 0 "Verify encryption certificate (vercrt)"
  102. #
  103. #}
  104. ############################## cmdtests_cleanup ########################
  105. # local shell function to finish this script (no exit since it might be
  106. # sourced)
  107. ########################################################################
  108. cmdtests_cleanup()
  109. {
  110. html "</TABLE><BR>"
  111. cd ${QADIR}
  112. . common/cleanup.sh
  113. }
  114. ################## main #################################################
  115. cmdtests_init
  116. #ct_vercrt
  117. cmdtests_cleanup