Project

General

Profile

action #57263

Updated by riafarov over 4 years ago

Follow-up ticket of #56786 with the remaining part that was not directly related with the library implementation: 

 ## Acceptance criteria 
 1. Simple non-destructive test is developed for yast2 hostname module (e.g. reading /etc/hosts and checking that all entries are displayed) 

 ## Further info 
 1) The test is destructive, it really modifies the /etc/hosts on the machine. 
 That's OK when running it in a testing environment (like openQA) but it's not 
 acceptable if you want to run the same test on your machine during development. 

 Ideally there should be a way to run the read-only and the read/write tests 
 separately. E.g. the read-only tests would simply press "Abort" button in the 
 end to avoid writing the changes to the system. 

 Or we could pass the read/write mode via the environment and depending on that the 
 "write" part would be skipped or not, that would avoid duplicating the tests. 

 We definitely need a way to safely run the tests (at least some safe subset) during the development. 

 2) Use the "aruba" gem for testing the file content, file existence, 
 file permissions, command STDOUT or STDERR, etc... 
 We do not need to reinvent the wheel in 
 https://github.com/jknphy/libyui_client/blob/master/spec/libyui_client_spec.rb#L39 

 So far Lady has used aruba only from cucumber tests, but it seems it provides some 
 helpers also for rspec. 

 See https://relishapp.com/cucumber/aruba/v/0-11-0/docs/file/check-if-file-has-content 

 Or maybe there is some other rspec extension for that, but as this is a really common problem, 
 some library (gem) must already exist...

Back