Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kickstart test to test hostname #112

Closed

Conversation

jkonecny12
Copy link
Member

Test is easy:

  • set network hostname
  • test it in the post section

@jkonecny12 jkonecny12 added the master Please, use the `f39` label instead. label May 21, 2015
@vpodzime
Copy link
Contributor

From what I found there is three ways how to test hostname.

  1. By hostname
  2. By reading /etc/hostname
  3. By hostnamectl --static

I could test all the three but I think they all do the same thing i.e. cat /etc/hostname.

I think we need to care most about the output of hostnamectl --static as that will be more and more used in the future and it may gather data from multiple places which we need to cover all.

@vpodzime
Copy link
Contributor

But now I realized that it wouldn't work as one would expect, I guess. It's probably again a fancy DBus thing that does nothing useful in combination with chroot(). So just checking the /etc/hostname looks as the best choice here to me.

@jkonecny12
Copy link
Member Author

Good point with the hostnamectl --static I will test it.

@jkonecny12
Copy link
Member Author

I added hostnamectl --static &> /root/TEST to my kickstart file and I get proper output (the TEST file was in /mnt/sysimage/root/) with proper content. So it seems to me as posible solution for testing.

@vpodzime
Copy link
Contributor

I added hostnamectl --static &> /root/TEST to my kickstart file and I get proper output (the TEST file was in /mnt/sysimage/root/) with proper content. So it seems to me as posible solution for testing.

That however tests a different thing. It's only my theory (based on quite a lot of disappointing experience with these "systemd-ish" services), but I think hostnamectl --static does a DBus call and the current runtime configuration is checked, not the configuration in the chroot (i.e. installed system).

@jkonecny12
Copy link
Member Author

So the /etc/hostname is the priority but I'm thinking of testing hostnamectl --static too. Even if this is read from the original system instead of chroot it could be tested.
What do you think?

@vpodzime
Copy link
Contributor

Yes, we could test that here as well. And at some point we may also add kickstart tests that test other phases of the installation process -- e.g. the hostname should be set in the installation environment way early than in the %post phase. But that's a separate issue.

@jkonecny12
Copy link
Member Author

Ok it's settled I change the tests to /etc/hostname and hostnamectl --static.

I want to ask one more question it's related to my other PR too (#117 and #115). I'm using network-* prefix now but from I found in PR #118 you didn't want the prefix. So I change this to without prefix variants.

So this test will be named as hostname.[ks|sh]. Other tests will be renamed in the same manner. Do you agree @vpodzime, @clumens ?

@clumens clumens added the ACK label May 26, 2015
@clumens
Copy link
Contributor

clumens commented May 26, 2015

Yeah, stripping out the network- prefix seems like a good idea here too.

@jkonecny12
Copy link
Member Author

Thank you much.
I'm going to do the changes locally and push it.

@jkonecny12 jkonecny12 closed this May 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master Please, use the `f39` label instead.
3 participants