[stream-refactor] allow doas_test to succeed on CentOS

Unlike on Debian, some environment variables that tickle
getpass.getuser() are being inherited. So use getuid() instead.

Also install the doas binary on CentOS. CI was changed (I believe) to
shrink the configuration matrix, and now these tests run on CentOS too.
pull/607/head
David Wilson 5 years ago
parent 2ba3973bc5
commit 2f950b3bda

@ -1,5 +1,4 @@
import getpass
import os
import mitogen
@ -59,7 +58,7 @@ class DoasTest(testlib.DockerMixin, testlib.TestCase):
password='has_sudo_password',
)
context = self.router.su(via=ssh, password='rootpassword')
self.assertEquals('root', context.call(getpass.getuser))
self.assertEquals(0, context.call(os.getuid))
if __name__ == '__main__':

@ -11,10 +11,13 @@ code, the OS X config just has the user accounts.
See ../README.md for a (mostly) description of the accounts created.
## Building the containers
``./build_docker_images.sh``
Requires Ansible 2.3.x.x in order to target CentOS 5
## Preparing an OS X box

@ -87,27 +87,24 @@
shell: locale-gen
when: distro == "Debian"
- name: Install prebuilt 'doas' binary on Debian
- name: Install prebuilt 'doas' binary
unarchive:
dest: /
src: ../data/docker/doas-debian.tar.gz
when: distro == "Debian"
- name: Make prebuilt 'doas' binary executable on Debian
- name: Make prebuilt 'doas' binary executable
file:
path: /usr/local/bin/doas
mode: 'u=rwxs,go=rx'
owner: root
group: root
when: distro == "Debian"
- name: Install doas.conf on Debian
- name: Install doas.conf
copy:
dest: /etc/doas.conf
content: |
permit :mitogen__group
permit :root
when: distro == "Debian"
- name: Vanilla Ansible needs simplejson on CentOS 5.
shell: mkdir -p /usr/lib/python2.4/site-packages/simplejson/

Loading…
Cancel
Save