Created
February 25, 2023 01:44
-
-
Save hallyn/b3334ac19f3e3edf05f805ff49cfa981 to your computer and use it in GitHub Desktop.
setup shadow tests in ubuntu container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cat /etc/apt/sources.list | |
| sed -i '/deb-src/d' /etc/apt/sources.list | |
| sed -i '/^deb /p;s/ /-src /' /etc/apt/sources.list | |
| export DEBIAN_PRIORITY=critical | |
| export DEBIAN_FRONTEND=noninteractive | |
| apt-get update | |
| apt-get -y dist-upgrade | |
| sudo apt-get -y install ubuntu-dev-tools automake autopoint \ | |
| xsltproc gettext eatmydata expect byacc libtool libbsd-dev \ | |
| pkgconf tmux | |
| su - ubuntu << EOF | |
| git clone https://github.com/shadow-maint/shadow | |
| cd shadow | |
| autoreconf -v -f --install | |
| ./autogen.sh --without-selinux --disable-man --with-yescrypt | |
| make -j4 | |
| EOF |
Author
+1 for no CI system lock-in.
Author
I'd love to see the complete set of commands you run to set up those. I've never worked with them. :)
Probably outside of the scope here mainly because I use different tools in different places :) For vm's on my main 'home' server, I use uvt-kvm, because I can do:
uvt-kvm create --memory 4096 --disk 30 rust release=jammy arch=amd64 --cpu 4 --run-script-once firstboot
For containers on my 'home' server I generally do
lxc-create -t download -n shadow -- -d ubuntu -r jammy - a amd64
lxc-start -n shadow
lxc-attach -n shadow -- << EOF
wget https://gisturl
./gist
EOF
In other environments I use lxd for both containers and vms. Those use cloud-init to specify a firstboot script.
Note that containers for shadow testsuite can be a problem as the testsuite uses a wide uid allocation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are Dockerfiles for RPM distros (Fedora, SuSE, RHEL, ...) any different at all? I expect the only difference is in the base image, which is already variable with an argument. If there's anything else different, maybe we can make it variable or maybe not. If not, sure, go for separate Dockerfiles.
About the location, I like to use FHS-like tree structures in my repos. That's why I chose
./share, which I use for the same meaning that/usr/sharewould have in a system. Dockerfiles are arch-independent, so that's a suitable place, I think.Nice.
:)
Without trying to convince you, I'll just say why I prefer local. It helps me compile, see the problems, and loop again until perfectly clean, very fast (much faster than going through the network, waiting to receive a notification, ...), and also I choose the interface (a terminal, much nicer than GH's or any other web GUI). After it succeeds locally, I know it's going to work in CI even before submitting (of course it may still fail, if I forgot something, or if there's some random behavior, but the chances are pretty low), so I reduce the noisy notifications that others will receive for each iteration of my tests and pushes.
--- Edit:
Oh, and another nice thing of having all tests local: you can always change the CI system; no lock-in, since it should work everywhere.