Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests-ng/chmod-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sg
# this is the test
################################################################

# pin umask so created files/dirs match the expected modes
umask 022

# $1 path
# $2 rights
has_rights()
Expand Down
3 changes: 3 additions & 0 deletions tests-ng/chmod-preserve-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sg
# this is the test
################################################################

# pin umask so created files/dirs match the expected modes
umask 022

# $1 path
# $2 rights
has_rights()
Expand Down
3 changes: 3 additions & 0 deletions tests-ng/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ echo -e "$(tput setaf 6)==> RUNNING $(basename "${BASH_SOURCE[0]}") <==$(tput sg
# this is the test
################################################################

# pin umask so created files/dirs match the expected modes
umask 022

get_file_mode()
{
u=$(umask)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def compare(self, opt, tmp, nbdotfiles):
for dotfile in dotfiles:
path = os.path.expanduser(dotfile.dst)
ret, _, insttmp = inst.install_to_temp(templ, tmp, dotfile.src,
dotfile.dst)
dotfile.dst,
chmod=dotfile.chmod)
if not ret:
results[path] = False
continue
Expand Down
6 changes: 6 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,12 @@ def test_creates_dst(self):

def test_prompts_to_replace_dst(self):
"""test prompts to replace dst"""
# pin umask so the created destination directory matches the
# source directory's mode (0o755) and the "replace" prompt is
# the only prompt issued
saved_umask = os.umask(0o022)
self.addCleanup(os.umask, saved_umask)

# create source dir
src_dir = get_tempdir()
self.assertTrue(os.path.exists(src_dir))
Expand Down
Loading