Skip to content

Add some symlink tests to runtime #79

@jeremyd2019

Description

@jeremyd2019

In msys2/msys2-runtime#254 (comment) I made a quick test to prove the current behavior of the deepcopy symlink type, and @dscho fleshed that out into something more automated in the linked comment. Thinking about trying to improve that deepcopy code more, I started thinking including tests of as much of the symlink behavior as possible would be helpful.

So far, I've thrown together this shell script to make all the objects I know how to create.

#!/bin/bash -e

# needs: coreutils openbsd-netcat

mkdir menagerie && cd menagerie

echo "this is a regular file" > file
mkdir dir
mknod block b 8 0
mknod char c 1 3
mkfifo fifo

# making a socket isn't as straightforward
(timeout 0.1 nc -klU socket || test $? -eq 124 && test -S socket)

# make a directory junction using cmd, since I don't think there's a cygwin
# way to do it
cmd //c "mklink /j dirjunction dir"

for wsym in lnk sys nativestrict deepcopy; do
	for dst in file dir dirjunction block char fifo socket; do
		MSYS=winsymlinks:${wsym} ln -s ${dst} ${dst}${wsym}
	done
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions