Project

General

Profile

action #41855

Updated by riafarov over 5 years ago

# yast2\_hostnames test module 

 ## Problems of Current Situation 

 
 test update 
 - Test goal is only to ensure it starts 

   > Summary: yast2\_hostnames check hostnames and add/delete hostsnames 
   > Make sure those yast2 modules can opened properly. We can add more 
   > feature test against each module later, it is ensure it will not crashed 
   > while launching atm. 

 - Only one hostname/ip change is "tested" 
 - No tests of bad input 
 - Change of hostname/ip is not verified (in the GUI) 
 - No verification if content in yast gui adds up with content in /etc/hosts 

 ## Goals 

 ### functionality 

 - ensure hostnames correctly **reads** from /etc/hosts 
  
   Validate the following IP + Hostname (+ aliases) **show up** in the GUI after 
   being entered into /etc/hosts. 

   - IPv4: 
     - `127.0.0.1 localhost` (one hostname) 
     - `130.57.5.70 suse.com suse.br suse.ae` (one hostname, multiple 
       aliases) 
   - IPv6: 
     - `::1 localhost ipv6-localhost ipv6-loopback` (ip with shortened 
       leading 0s, one hostname, multiple aliases) 
     - `fe00::0 ipv6-localnet` (local ip with shortened 0s in the middle, one hostname) 
     - `2001:db8:0:0:0:ff00:42:8329 example1` (public ip with semi-shortened 0s, one 
       hostname) 
     - `2001:db8::ff00:42:8329    example2` (public ip with shortened 0s in the middle, 
       one hostname) 

   Validate comments **do not** show up: 

   - `# 147.67.34.45 europa.eu` 
   - `# special IPv6 addresses` 
   - `# ff02::4 example3` 

 - ensure hostnames correctly **writes** to /etc/hosts 
  
   Validate the following IP + Hostname (+aliases) **show up** in /etc/hosts after 
   being added via the GUI. 

   - IPv4: 

     - `130.57.5.70 suse.com suse.br suse.ae` 

   - IPv6: 

     - `2001:db8:0:0:0:ff00:42:8329 example1` 
     - `2001:db8::ff00:42:8329 example2` 

 - ensure hostnames enforce syntax 

   - validate it is **not possible** to enter comments via the GUI prompt 
     - try to enter "# comment", expected: "comment" 
   - validate only `[0-9a-zA-Z.:]` **can be entered** into the IP Address field. 
     - try to enter 
       "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.:!@#$%^&*[](){}", 
       expected: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.:" 

 - Validate that a verification prompt appears for system hosts (e.g. localhost) 
   when trying to edit or delete an entry (test with ::1 and 127.0.0.1) 

 - check behavior against documentation 
   - adding / editing works when the "Host aliases" field in the popup is empty 
     (covered by "writing" test above) 

 - Check duplicate entries appear only once 
 - open large /etc/hosts file 

 ### non-functional 

 #### usability 

 - ensure all required buttons are visible and working correctly 

   1. click on "Help" and verify a popup with help text (ignore what is written) 
     shows up. Click on "Close" and verify it closes again. 
   2. click on "Add", enter "123" in the automatically selected field (IP), click 
     on "Cancel". Verify nothing changed. Click on "Add" again, this time enter 
     one of the IP/Hostname combinations (130.57.5.70 suse.com suse.br suse.ae) 
     and click on "Ok". Verify the entry is visible in the GUI. 
   3. Select the added entry in the step above, click on "Edit". Remove both 
     aliases and press "Ok". Verify the aliases are not shown in the GUI. 
   4. Select the same entry, click on "Delete". Verify the whole entry is not 
     shown in the GUI. 
   5. Click on "Cancel", verify a confirmation pop up shows up. Click on "No", 
     verify the popup closed. Click on "Cancel", then on "Yes". Verify the GUI 
     closed itself. 

   1. *New Run*: Repeat step 2, then click on "Ok". Now the correct writing to 
      /etc/hosts can be verified. 

 - ensure labels (strings) don't overlap / are out of position 

 - verify UI is intuitive 
  
   Possible manual way: Monitor someone who never used it before who uses it to 
   accomplish the task of adding, editing and deleting an entry. Ask the person 
   to think out loud the whole time. 

   This test does not need to happen as often as other since major UI changed 
   are not expected to    occur as often as functional changed (e.g. regressions). 
  
 - ensure all keyboard shortcuts are indicated (ncurses) and working correctly 
 
   I am not sure how easy / reliable it is to test this automatically since they 
   get generated at runtime if I remember correctly (need to confirm this). 
  
   On the other hand: Is a user expecting these shortcuts to change? Users often 
   remember them and trust their memories to save time (i.e. press the keys 
   before checking if the combination is still correct). 

 - translations 

 #### performance 

 - memory usage 

 #### portability 

 - different arch 
 - different DEs 
 - ncurses 
 - x11/wayland 

 #### compability 

 - editing via text editor while module is in use (automatic refresh? manual 
   refresh after notification?) 

Back