[Pkg-samba-maint] [Git][samba-team/samba][master] 7 commits: * Add extra DEP8 tests to samba (LP #1696823):
Mathieu Parent
gitlab at salsa.debian.org
Thu Mar 1 20:22:02 UTC 2018
Mathieu Parent pushed to branch master at Debian Samba Team / samba
Commits:
da1b9b78 by Andreas Hasenack at 2018-02-09T11:44:53-02:00
* Add extra DEP8 tests to samba (LP #1696823):
- d/t/control, d/t/cifs-share-access: access a file in a share using cifs
- - - - -
bb2310ef by Andreas Hasenack at 2018-02-09T11:44:53-02:00
- d/t/control, d/t/smbclient-anonymous-share-list: list available shares
anonymously
- - - - -
591ba3f2 by Andreas Hasenack at 2018-02-09T11:44:54-02:00
- d/t/control, d/t/smbclient-authenticated-share-list: list available
shares using an authenticated connection
- - - - -
9c9d7f02 by Andreas Hasenack at 2018-02-09T11:44:54-02:00
- d/t/control, d/t/smbclient-share-access: create a share and download a
file from it
- - - - -
f9458544 by Andreas Hasenack at 2018-02-09T11:44:54-02:00
changelog
- - - - -
0fddc2c6 by Andreas Hasenack at 2018-02-14T17:46:38-02:00
Updated changelog with debian bug number.
- - - - -
999bece6 by Mathieu Parent at 2018-03-01T20:21:52+00:00
Merge branch 'more-dep8-tests' into 'master'
More dep8 tests
See merge request samba-team/samba!1
Closes: #890439.
- - - - -
6 changed files:
- debian/changelog
- + debian/tests/cifs-share-access
- debian/tests/control
- + debian/tests/smbclient-anonymous-share-list
- + debian/tests/smbclient-authenticated-share-list
- + debian/tests/smbclient-share-access
Changes:
=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+samba (2:4.7.4+dfsg-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Add extra DEP8 tests to samba (Closes: #890439):
+ - d/t/control, d/t/cifs-share-access: access a file in a share using cifs
+ - d/t/control, d/t/smbclient-anonymous-share-list: list available shares
+ anonymously
+ - d/t/control, d/t/smbclient-authenticated-share-list: list available
+ shares using an authenticated connection
+ - d/t/control, d/t/smbclient-share-access: create a share and download a
+ file from it
+
+ -- Andreas Hasenack <andreas at canonical.com> Wed, 14 Feb 2018 17:46:13 -0200
+
samba (2:4.7.4+dfsg-1) unstable; urgency=medium
* New upstream version
=====================================
debian/tests/cifs-share-access
=====================================
--- /dev/null
+++ b/debian/tests/cifs-share-access
@@ -0,0 +1,40 @@
+#!/bin/sh -x
+
+if ! testparm -s 2>&1 | grep -qE "^\[homes\]"; then
+ echo "Adding [homes] share"
+ cat >> /etc/samba/smb.conf <<EOFEOF
+[homes]
+ valid users = %S
+ read only = no
+ guest ok = no
+EOFEOF
+ systemctl reload smbd.service
+else
+ echo "No need to add [homes] share, continuing."
+fi
+
+username="smbtest$$"
+password="$$"
+echo "Creating a local test user called ${username}"
+useradd -m "$username"
+echo "Setting samba password for the ${username} user"
+echo "${password}\n${password}" | smbpasswd -s -a ${username}
+userhome=$(eval echo ~$username)
+echo "Creating file with random data and computing its md5"
+dd if=/dev/urandom bs=1 count=128 2>/dev/null | base64 > ${userhome}/data
+chown ${username}:${username} ${userhome}/data
+cd ${userhome}
+md5sum data > data.md5
+
+echo "Mounting //localhost/${username} via CIFS"
+temp_mount=$(mktemp -d)
+mount -t cifs //localhost/${username} "$temp_mount" -o user=${username},username=${username},password=${password}
+
+echo "Verifying MD5 via cifs"
+cd "$temp_mount"
+md5sum -c data.md5
+result=$?
+cd -
+umount "$temp_mount"
+rmdir "$temp_mount"
+exit "$result"
=====================================
debian/tests/control
=====================================
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,18 @@
+Tests: cifs-share-access
+Depends: samba, coreutils, systemd, cifs-utils, passwd
+Restrictions: needs-root, allow-stderr, isolation-machine
+
Tests: python-smoke
Depends: python-samba
+
+Tests: smbclient-anonymous-share-list
+Depends: samba, smbclient
+Restrictions: allow-stderr, isolation-container
+
+Tests: smbclient-authenticated-share-list
+Depends: samba, smbclient, passwd
+Restrictions: needs-root, allow-stderr, isolation-container
+
+Tests: smbclient-share-access
+Depends: samba, smbclient, coreutils, systemd, passwd
+Restrictions: needs-root, allow-stderr, isolation-container
=====================================
debian/tests/smbclient-anonymous-share-list
=====================================
--- /dev/null
+++ b/debian/tests/smbclient-anonymous-share-list
@@ -0,0 +1,3 @@
+#!/bin/sh -x
+
+smbclient -N -L localhost
=====================================
debian/tests/smbclient-authenticated-share-list
=====================================
--- /dev/null
+++ b/debian/tests/smbclient-authenticated-share-list
@@ -0,0 +1,17 @@
+#!/bin/sh -x
+
+username="smbtest$$"
+password="$$"
+
+echo "Creating a local test user called ${username}"
+useradd -m "$username"
+
+echo "Setting samba password for the ${username} user"
+echo "${password}\n${password}" | smbpasswd -s -a ${username}
+
+echo "Testing with incorrect password: must fail"
+smbclient -L localhost -U ${username}%wrongpass && exit 1
+
+echo "Testing with correct password: must work"
+smbclient -L localhost -U ${username}%${password}
+
=====================================
debian/tests/smbclient-share-access
=====================================
--- /dev/null
+++ b/debian/tests/smbclient-share-access
@@ -0,0 +1,34 @@
+#!/bin/sh -x
+
+if ! testparm -s 2>&1 | grep -qE "^\[homes\]"; then
+ echo "Adding [homes] share"
+ cat >> /etc/samba/smb.conf <<EOFEOF
+[homes]
+ valid users = %S
+ read only = no
+ guest ok = no
+EOFEOF
+ systemctl reload smbd.service
+else
+ echo "No need to add [homes] share, continuing."
+fi
+
+username="smbtest$$"
+password="$$"
+echo "Creating a local test user called ${username}"
+useradd -m "$username"
+echo "Setting samba password for the ${username} user"
+echo "${password}\n${password}" | smbpasswd -s -a ${username}
+userhome=$(eval echo ~$username)
+echo "Creating file with random data and computing its md5"
+dd if=/dev/urandom bs=1 count=128 2>/dev/null | base64 > ${userhome}/data
+chown ${username}:${username} ${userhome}/data
+cd ${userhome}
+md5sum data > data.md5
+
+rm -f downloaded-data
+echo "Downloading file and comparing its md5"
+smbclient //localhost/${username} -U ${username}%${password} -c "get data downloaded-data"
+
+mv -f downloaded-data data
+md5sum -c data.md5
View it on GitLab: https://salsa.debian.org/samba-team/samba/compare/4ef9e5af4c28bd432fc6aa942a065766a4dffeea...999bece68923e5c50670f2386c6539cd2e053442
---
View it on GitLab: https://salsa.debian.org/samba-team/samba/compare/4ef9e5af4c28bd432fc6aa942a065766a4dffeea...999bece68923e5c50670f2386c6539cd2e053442
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20180301/14f6acf7/attachment-0001.html>
More information about the Pkg-samba-maint
mailing list