Skip to content

Commit

Permalink
Bring back copy of common files removed by error
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Jan 18, 2023
1 parent b4b4d19 commit ffcd364
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/network/clients/save_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def copy_from_instsys

log.info("Copy network configuration files from 1st stage into installed system")
copy_dhcp_info
copy_common_files
config_copier_for(backend)&.copy
end

Expand Down
1 change: 1 addition & 0 deletions test/data/instsys/etc/hostname
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
7 changes: 7 additions & 0 deletions test/save_network_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
FileUtils.remove_entry(destdir) if Dir.exist?(destdir)
end

it "copies /etc/hostname and /etc/hosts when exist" do
subject.main
expect(File).to_not exist(File.join(destdir, "etc", "hosts"))
content = File.read(File.join(destdir, "etc", "hostname"))
expect(content).to match(/test/)
end

it "copies wicked and DHCP files under /var/lib" do
subject.main
expect(File).to exist(File.join(destdir, "var", "lib", "dhcp", "dhclient.leases"))
Expand Down

0 comments on commit ffcd364

Please sign in to comment.