]> Cypherpunks repositories - gostls13.git/commitdiff
os: skip TestReadlink sub-tests requiring symlinks when not enough
authorqmuntal <quimmuntal@gmail.com>
Fri, 20 Sep 2024 14:51:50 +0000 (16:51 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 23 Sep 2024 18:00:57 +0000 (18:00 +0000)
permissions are held

Some of the TestReadlink sub-tests require os.Symlink to succeed.
If the user doesn't have enough permissions to create symlinks, then
there is no point in running the test.

Change-Id: I06ec7e3ddf0016e804667bba0ee6ebe6baa01872
Reviewed-on: https://go-review.googlesource.com/c/go/+/614655
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/os/os_windows_test.go

index c8a133da81a681e50fea6b2ccc1b329b38729612..fb95499c17ff464a33c432c790d673a46247ecd0 100644 (file)
@@ -1269,6 +1269,9 @@ func TestReadlink(t *testing.T) {
                }
 
                t.Run(name, func(t *testing.T) {
+                       if !tt.junction {
+                               testenv.MustHaveSymlink(t)
+                       }
                        if !tt.relative {
                                t.Parallel()
                        }