Merge pull request #1915 from florindragos/FACT-2515
Gheorghe Popescu authored 4 years ago
GitHub committed 4 years ago
56 | 56 | step "should log that it creates cache file and it caches custom facts found in facter.conf" do |
57 | 57 | on(agent, facter("#{custom_fact_name} --debug", environment: env)) do |facter_result| |
58 | 58 | assert_equal(custom_fact_value, facter_result.stdout.chomp, "#{custom_fact_name} value changed") |
59 | assert_match(/Custom facts cache file expired\/missing. Refreshing/, facter_result.stderr, | |
59 | assert_match(/facts cache file expired\/missing/, facter_result.stderr, | |
60 | 60 | 'Expected debug message to state that custom facts cache file is missing or expired') |
61 | assert_match(/Saving cached custom facts to ".+"/, facter_result.stderr, | |
61 | assert_match(/Saving cached custom facts to ".+"|caching values for cached-custom-facts facts/, facter_result.stderr, | |
62 | 62 | 'Expected debug message to state that custom facts will be cached') |
63 | 63 | end |
64 | 64 | end |
74 | 74 | |
75 | 75 | step 'should read from the cached file for a custom fact that has been cached' do |
76 | 76 | on(agent, facter("#{custom_fact_name} --debug", environment: env)) do |facter_result| |
77 | assert_match(/Loading cached custom facts from file ".+"/, facter_result.stderr, | |
77 | assert_match(/Loading cached custom facts from file ".+"|loading cached values for cached-custom-facts facts/, facter_result.stderr, | |
78 | 78 | 'Expected debug message to state that cached custom facts are read from file') |
79 | 79 | end |
80 | 80 | end |