Skip to content

Commit

Permalink
8227422: sun/net/www/protocol/file/DirPermissionDenied.java failed on…
Browse files Browse the repository at this point in the history
… Windows 2016 because DirPermissionDenied directory has no read permission

Backport-of: 0518393
  • Loading branch information
GoeLin committed Feb 17, 2023
1 parent 98e3b0d commit 43e53a3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/jdk/sun/net/www/protocol/file/DirPermissionDenied.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -90,8 +90,12 @@ public void setup() throws Throwable {
}

@AfterTest
public void tearDown() throws IOException {
public void tearDown() throws Throwable {
// add read permission to ensure the dir removable
ProcessTools.executeCommand("chmod", "733", TEST_DIR.toString())
.outputTo(System.out)
.errorTo(System.out)
.shouldHaveExitValue(0);
FileUtils.deleteFileIfExistsWithRetry(TEST_DIR);
}
}

1 comment on commit 43e53a3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.