~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to lib/subunit/shell/tests/test_function_output.sh

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#  subunit shell bindings.
 
3
#  Copyright (C) 2006  Robert Collins <robertc@robertcollins.net>
 
4
#
 
5
#  Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
 
6
#  license at the users choice. A copy of both licenses are available in the
 
7
#  project source as Apache-2.0 and BSD. You may not use this file except in
 
8
#  compliance with one of these two licences.
 
9
#  
 
10
#  Unless required by applicable law or agreed to in writing, software
 
11
#  distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
 
12
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 
13
#  license you chose for the specific language governing permissions and
 
14
#  limitations under that license.
 
15
#
 
16
 
 
17
 
 
18
# this script tests the output of the methods. As each is tested we start using
 
19
# it.
 
20
# So the first test manually implements the entire protocol, the next uses the
 
21
# start method and so on.
 
22
# it is assumed that we are running from the 'shell' tree root in the source
 
23
# of subunit, and that the library sourcing tests have all passed - if they 
 
24
# have not, this test script may well fail strangely.
 
25
 
 
26
# import the library.
 
27
. ${SHELL_SHARE}subunit.sh
 
28
 
 
29
echo 'test: subunit_start_test output'
 
30
func_output=$(subunit_start_test "foo bar")
 
31
func_status=$?
 
32
if [ $func_status == 0 -a "x$func_output" = "xtest: foo bar" ]; then
 
33
  echo 'success: subunit_start_test output'
 
34
else
 
35
  echo 'failure: subunit_start_test output ['
 
36
  echo 'got an error code or incorrect output:'
 
37
  echo "exit: $func_status"
 
38
  echo "output: '$func_output'"
 
39
  echo ']' ;
 
40
fi
 
41
 
 
42
subunit_start_test "subunit_pass_test output"
 
43
func_output=$(subunit_pass_test "foo bar")
 
44
func_status=$?
 
45
if [ $func_status == 0 -a "x$func_output" = "xsuccess: foo bar" ]; then
 
46
  subunit_pass_test "subunit_pass_test output"
 
47
else
 
48
  echo 'failure: subunit_pass_test output ['
 
49
  echo 'got an error code or incorrect output:'
 
50
  echo "exit: $func_status"
 
51
  echo "output: '$func_output'"
 
52
  echo ']' ;
 
53
fi
 
54
 
 
55
subunit_start_test "subunit_fail_test output"
 
56
func_output=$(subunit_fail_test "foo bar" <<END
 
57
something
 
58
  wrong
 
59
here
 
60
END
 
61
)
 
62
func_status=$?
 
63
if [ $func_status == 0 -a "x$func_output" = "xfailure: foo bar [
 
64
something
 
65
  wrong
 
66
here
 
67
]" ]; then
 
68
  subunit_pass_test "subunit_fail_test output"
 
69
else
 
70
  echo 'failure: subunit_fail_test output ['
 
71
  echo 'got an error code or incorrect output:'
 
72
  echo "exit: $func_status"
 
73
  echo "output: '$func_output'"
 
74
  echo ']' ;
 
75
fi
 
76
 
 
77
subunit_start_test "subunit_error_test output"
 
78
func_output=$(subunit_error_test "foo bar" <<END
 
79
something
 
80
  died
 
81
here
 
82
END
 
83
)
 
84
func_status=$?
 
85
if [ $func_status == 0 -a "x$func_output" = "xerror: foo bar [
 
86
something
 
87
  died
 
88
here
 
89
]" ]; then
 
90
  subunit_pass_test "subunit_error_test output"
 
91
else
 
92
  subunit_fail_test "subunit_error_test output" <<END
 
93
got an error code or incorrect output:
 
94
exit: $func_status
 
95
output: '$func_output'
 
96
END
 
97
fi