Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Added new failing test for windows junction points" #19612

Merged
merged 1 commit into from
Nov 1, 2024
Merged
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
25 changes: 0 additions & 25 deletions test/modules/post/test/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,6 @@ def test_dir
ret
end
end

if (session.platform == 'windows')
it 'should delete a junction target' do
mkdir(datastore['BaseDirectoryName'])
ret = directory?(datastore['BaseDirectoryName'])
link = "#{datastore['BaseDirectoryName']}.junc"
ret &&= write_file([datastore['BaseDirectoryName'], 'file'].join(fs_sep), '')
make_junction(datastore['BaseDirectoryName'], link)
unless exists?(link)
print_error('failed to create the symbolic link')
end
rm_rf(link)
# the link should have been deleted
ret &&= !exists?(link)
# but the target directory and its contents should still be intact
ret &&= exists?("#{[datastore['BaseDirectoryName'], 'file'].join(fs_sep)}")
rm_rf(datastore['BaseDirectoryName'])
ret
end
end

end

def test_file
Expand Down Expand Up @@ -310,10 +289,6 @@ def test_path_expansion_nix
end
end

def make_junction(target, symlink)
cmd_exec("cmd.exe", "/c mklink #{directory?(target) ? '/J ' : ''}#{symlink} #{target}")
end

def make_symlink(target, symlink)
if session.platform == 'windows'
cmd_exec("cmd.exe", "/c mklink #{directory?(target) ? '/D ' : ''}#{symlink} #{target}")
Expand Down
Loading