See <https://ci.suse.de/job/yast-ntp-client-master/24/display/redirect?page=changes> Changes: [jreidinger] adapt to new CFA [jreidinger] changes [jreidinger] fail if write failed [jreidinger] fix writing new records [jreidinger] fix writting new entries [jreidinger] better structure test [jreidinger] rephrase usage note [jreidinger] attempt to write real test for writting [jreidinger] use trick to reinit always module for clean testing [jreidinger] fix wrong order of test [jreidinger] update dependency [jreidinger] fix writing test to really act on changed scr and to not ignore reported [jreidinger] Add test for removing records [jreidinger] add to gitignore result of test [jreidinger] Make test really independent on each run and unify chrooting [jreidinger] make rubocop happy ------------------------------------------ [...truncated 56.18 KB...] [ 7s] CFA::NtpConf::RestrictRecord [ 7s] #options [ 8s] obtains the options of the record (FAILED - 1) [ 8s] #options= [ 8s] sets options to the record (FAILED - 2) [ 8s] #raw_options [ 8s] obtains options as string (FAILED - 3) [ 8s] #raw_options= [ 8s] sets options from a string (FAILED - 4) [ 8s] [ 8s] Yast::NtpClientMiscInclude [ 8s] string2opts [ 8s] given a string of options, a list of options with params and other without params [ 8s] returns a hash of parsed and unkown options [ 8s] [ 8s] #<Yast::NtpClientClass:0x00000001d17aa8> [ 8s] #AutoYaST methods [ 8s] #Import [ 8s] with a correct AutoYaST configuration file [ 8s] reads the list of peers [ 8s] reads the list of restricts [ 8s] reads synchronize flag [ 8s] reads start at boot flag [ 8s] reads start in chroot environment flag [ 8s] reads policy [ 8s] reads sync intervall [ 8s] with an empty AutoYaST configuration [ 8s] sets an empty peer list [ 8s] sets an empty restricts list [ 8s] sets default synchronize flag [ 8s] sets default start at boot flag [ 8s] sets default start in chroot environment flag [ 8s] sets default policy [ 8s] set default sync intervall [ 8s] #Export [ 8s] produces an output equivalent to #Import [ 8s] #Read [ 8s] when config has been read previously [ 8s] returns true [ 8s] when config has not been read [ 8s] returns false if abort is pressed [ 9s] doesn't show progress if it is not in normal Mode [ 10s] reads network interfaces config [ 10s] reads ntp policy [ 11s] loads known ntp servers and known country names [ 11s] checks if ntpd service is enable [ 12s] reads ntp config from /etc/ntp.conf [ 12s] reads synchronization config [ 13s] reads ntpd chroot config [ 13s] returns true if all reads were performed [ 13s] when Mode is not installation [ 13s] returns false if the ntp package neither is installed nor available [ 13s] when active directory's ntp dumped data file exists [ 14s] reads active directory address from file [ 14s] #Write [ 14s] returns false if abort is pressed [ 14s] writes current ntp records to ntp config [ 14s] writes new ntp records to ntp config [ 14s] does not write removed records to ntp config [ 14s] writes ntp policy and updates ntp with netconfig [ 14s] writes chroot ntp config [ 14s] calls SuSEFirewall.Write to check pending changes [ 14s] checks ntp service [ 14s] updates cron settings [ 14s] returns true if not aborted [ 14s] #MakePoolRecord [ 14s] returns a pool ntp record for the given country code and location [ 14s] returns a pool ntp record with 'uk.pool.ntp.org' address if country code is GB [ 14s] #GetNtpServers [ 14s] when ntp servers haven't been read before [ 14s] caches known ntp servers [ 14s] returns known ntp servers [ 14s] when ntp servers have been read before [ 14s] returns known ntp servers [ 14s] #IsRandomServersServiceEnabled [ 14s] returns true if all random pool ntp servers are in use [ 14s] returns false in other case [ 14s] #DeActivateRandomPoolServersFunction [ 14s] removes random pool ntp servers from @ntp_records [ 14s] #GetNtpServersByCountry [ 14s] gets all ntp servers [ 14s] gets all country names if given country name is an empty string [ 14s] returns a list of items with read servers (PENDING: Not yet implemented) [ 14s] #ReadSynchronization [ 14s] reads cron file [ 14s] when cron file does not exist [ 14s] sets synchronize_time as false [ 14s] sets sync interval with default value [ 14s] when cron file exists [ 14s] when there is no cron entry [ 14s] sets synchronize_time as false [ 14s] sets sync interval with default value [ 14s] when there is cron entry [ 14s] sets synchronize time as true if first cron entry is valid [ 14s] sets sync_interval with cron minute interval [ 14s] #reachable_ntp_server? [ 14s] given a server [ 14s] returns true if sntp test passed with IPv4 [ 14s] returns true if sntp test passed with IPv6 [ 14s] returns false if sntp test fails with IPv4 and with IPv6 [ 14s] #sntp_test [ 14s] calls sntp command with ip version 4 by default [ 14s] returns false if server is not reachable [ 14s] returns false if sntp response includes 'no UCST' [ 14s] returns true if sntp command's exit code is 0 [ 14s] #TestNtpServer [ 15s] returns true if ntp server is reachable [ 15s] returns false if ntp server is not reachable [ 15s] when given verbosity is :no_ui [ 15s] doesn't show any dialog [ 15s] when given verbosity is :result_popup [ 15s] shows Feedback Popup [ 15s] notifies with a Popup if success [ 15s] reports with an error if not reachable server [ 15s] when given vervosity is any other argument [ 15s] only shows Feedback Popup [ 15s] #GetUsedNtpServers [ 15s] returns a list of NTP servers used in the current configuration [ 15s] #getSyncRecords [ 15s] returns a map's list with current synchronization related entries with index [ 15s] #selectSyncRecord [ 15s] when given index is not between -1 an ntp_records size [ 15s] returns false [ 15s] sets selected_index as -1 [ 15s] sets selected_record as an empty hash [ 15s] when given index is -1 [ 15s] sets selected_index as -1 [ 15s] sets selected_record as an empty hash [ 15s] returns true [ 15s] when given index is between 0 and ntp_records size [ 15s] sets selected_index as given value [ 15s] sets selected_record as the ntp_records entry for given index [ 15s] returns true [ 15s] #deleteSyncRecord [ 15s] returns false if given index is not in @ntp_records size range [ 16s] returns true otherwise [ 16s] sets modified as true if deleted record [ 16s] removes record entry from ntp records at given index position [ 16s] #ProcessNtpConf [ 16s] returns false if config has been read previously [ 16s] returns false if config doesn't exist [ 16s] sets configuration as read and returns true [ 16s] initializes ntp records excluding restrict and fudge entries [ 16s] initializes restrict records (FAILED - 5) [ 16s] #read_ad_address! [ 16s] when there is an active directory data file [ 16s] reads and sets active directory controller [ 16s] removes data file if controller is read [ 16s] #read_chroot_config! [ 16s] reads sysconfig NTPD_RUN_CHROOTED variable [ 16s] when NTPD_RUN_CHROOTED variable doesn't exist [ 16s] returns false [ 16s] when NTPD_RUN_CHROOTED variable exists [ 16s] returns true [ 16s] sets ntpd as chrooted if variable is 'yes' [ 16s] sets ntpd as no chrooted in any other case [ 16s] #update_ntp_servers! [ 16s] initializes ntp_servers as an empty hash [ 16s] adds known servers to ntp_servers [ 16s] adds ntp pool servers for known countries to ntp_servers [ 16s] [ 16s] Pending: (Failures listed here are expected and do not affect your suite's status) [ 16s] [ 16s] 1) #<Yast::NtpClientClass:0x00000001d17aa8> #GetNtpServersByCountry returns a list of items with read servers [ 16s] # Not yet implemented [ 16s] # ./test/ntp_client_test.rb:449 [ 16s] [ 16s] Failures: [ 16s] [ 16s] 1) CFA::NtpConf::RestrictRecord#options obtains the options of the record [ 16s] Failure/Error: expect(record.options).to eq(%w(notrap nomodify nopeer)) [ 16s] [ 16s] expected: ["notrap", "nomodify", "nopeer"] [ 16s] got: ["default", "notrap", "nomodify", "nopeer"] [ 16s] [ 16s] (compared using ==) [ 16s] # ./test/cfa/ntp_conf_test.rb:381:in `block (3 levels) in <top (required)>' [ 16s] [ 16s] 2) CFA::NtpConf::RestrictRecord#options= sets options to the record [ 16s] Failure/Error: expect(file.content).to include("restrict -4 default notrap\n") [ 16s] expected "restrict -4 notrap\n" to include "restrict -4 default notrap\n" [ 16s] Diff: [ 16s] @@ -1,2 +1,2 @@ [ 16s] -restrict -4 default notrap\n [ 16s] +restrict -4 notrap [ 16s] # ./test/cfa/ntp_conf_test.rb:391:in `block (3 levels) in <top (required)>' [ 16s] [ 16s] 3) CFA::NtpConf::RestrictRecord#raw_options obtains options as string [ 16s] Failure/Error: expect(record.raw_options).to eq("notrap nomodify nopeer") [ 16s] [ 16s] expected: "notrap nomodify nopeer" [ 16s] got: "default notrap nomodify nopeer" [ 16s] [ 16s] (compared using ==) [ 16s] # ./test/cfa/ntp_conf_test.rb:397:in `block (3 levels) in <top (required)>' [ 16s] [ 16s] 4) CFA::NtpConf::RestrictRecord#raw_options= sets options from a string [ 16s] Failure/Error: expect(file.content).to include("restrict -4 default notrap\n") [ 16s] expected "restrict -4 notrap\n" to include "restrict -4 default notrap\n" [ 16s] Diff: [ 16s] @@ -1,2 +1,2 @@ [ 16s] -restrict -4 default notrap\n [ 16s] +restrict -4 notrap [ 16s] # ./test/cfa/ntp_conf_test.rb:406:in `block (3 levels) in <top (required)>' [ 16s] [ 16s] 5) #<Yast::NtpClientClass:0x00000001d17aa8> #ProcessNtpConf initializes restrict records [ 16s] Failure/Error: expect(subject.restrict_map.size).to eql(3) [ 16s] [ 16s] expected: 3 [ 16s] got: 4 [ 16s] [ 16s] (compared using eql?) [ 16s] # ./test/ntp_client_test.rb:786:in `block (3 levels) in <top (required)>' [ 16s] # ./test/ntp_client_test.rb:25:in `block (2 levels) in <top (required)>' [ 16s] [ 16s] Finished in 8.84 seconds (files took 0.92117 seconds to load) [ 16s] 136 examples, 5 failures, 1 pending [ 16s] [ 16s] Failed examples: [ 16s] [ 16s] rspec ./test/cfa/ntp_conf_test.rb:380 # CFA::NtpConf::RestrictRecord#options obtains the options of the record [ 16s] rspec ./test/cfa/ntp_conf_test.rb:386 # CFA::NtpConf::RestrictRecord#options= sets options to the record [ 16s] rspec ./test/cfa/ntp_conf_test.rb:396 # CFA::NtpConf::RestrictRecord#raw_options obtains options as string [ 16s] rspec ./test/cfa/ntp_conf_test.rb:402 # CFA::NtpConf::RestrictRecord#raw_options= sets options from a string [ 16s] rspec ./test/ntp_client_test.rb:784 # #<Yast::NtpClientClass:0x00000001d17aa8> #ProcessNtpConf initializes restrict records [ 16s] [ 16s] rake aborted! [ 16s] Command failed with status (1): [rspec --color --format doc 'test/cfa/ntp_c...] [ 16s] [ 16s] Tasks: TOP => test:unit [ 16s] (See full trace by running task with --trace) [ 16s] error: Bad exit status from /var/tmp/rpm-tmp.hdDTv2 (%check) [ 16s] [ 16s] [ 16s] RPM build errors: [ 16s] Bad exit status from /var/tmp/rpm-tmp.hdDTv2 (%check) [ 16s] [ 16s] vm-yast-ci-worker failed "build yast2-ntp-client.spec" at Thu Mar 23 12:25:46 UTC 2017. [ 16s] The buildroot was: /var/tmp/build-root-sle12_sp3 rm -rf Devel:YaST:Head rake aborted! Command failed with status (1): [yes | osc -A 'https://api.suse.de/' build ...] Tasks: TOP => osc:sr => osc:commit => osc:build (See full trace by running task with --trace) cleaning Build step 'Execute shell' marked build as failure