-
Notifications
You must be signed in to change notification settings - Fork 898
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
FileDepotFtp: FTP.nlst cannot distinguish empty from non-existent dir #9127
Conversation
My theory, why we haven't seen this before is that we tested the previous bugs with either non existent directories or with non-empty. The new bug is about seeing the empty directory. |
@@ -93,12 +93,15 @@ def file_exists?(file_or_directory) | |||
private | |||
|
|||
def create_directory_structure(directory_path) | |||
Pathname.new(directory_path).descend do |path| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. The new code drills down the directory structure by mkdir A; chdir A
the same way. So the IIS's inability to create directories like mkdir -p
should not be a problem. However, I will try to get some IIS for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isimluk Please ask around and let me know if you can't get access for testing. Also, if you have ideas on how to capture this behavior so we can automate tests to avoid regression, I'd love to hear any ideas.
I'm fine with the change but would want some sanity checks on various ftps. Maybe @jcarter12 can DM you some information to test against the ftp they use for anonymous access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you have ideas on how to capture this behavior so we can automate tests
to avoid regression, I'd love to hear any ideas.
I think the approach I had taken in the second commit of this PR can really help us in that regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'd like an examples for iis and anonymous ftp that @jcarter12 before merge though. We've changed things for other ftps in the past and I feel like this might cause a regression without confirmation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too. Will advise QE on testing in the BZ.
Meh, I referenced wrong bz first time. I have amended pr with the right bz now (https://bugzilla.redhat.com/show_bug.cgi?id=1341502) 😢 |
https://bugzilla.redhat.com/show_bug.cgi?id=1341502 The problem is that we cannot rely on fpt.nlst to give exception when file is not available. With vsftpd 3.0.2-14.fc23 and Ruby-2.2.0 Net::FTP I get behaviour like the following ftp.nlst('/') => ["/incoming", "/pub"] ftp.nlst('/incomming') => [] ftp.nlst('/non-existent') => []
I feel we need some better mocking then just rspec's double. There are differences between various ftp servers and we keep touching FileDepotFtp code as we see saw these differences comming. The tests based on rspec's double are not the useful in this case as they need to be rewritten each time we change the code logic. At that point we may re-introduce bugs for certain ftp servers. Let's build the knowledge about specific servers behavior in the spec. https://bugzilla.redhat.com/show_bug.cgi?id=1341502
Checked commits isimluk/manageiq@f40f36a~...f87471a with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 spec/models/file_depot_ftp_spec.rb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks! |
Create directory structure by descending down
https://bugzilla.redhat.com/show_bug.cgi?id=1341502
The problem is that we cannot rely on
fpt.nlst
to give exception whenfile is not available. With vsftpd 3.0.2-14.fc23 and Ruby-2.2.0 Net::FTP
I get behaviour like the following
@miq-bot add_label darga/no, bug, core