stephane-klein / dotfiles

It is my work in progress dotfiles managed by Chezmoi
2 stars 0 forks source link

Étudier et tester les solutions permettant de tester (test d'intégration) les scripts d'installation "chezmoi" #84

Open stephane-klein opened 1 year ago

stephane-klein commented 1 year ago

Étudier et tester les solutions permettant de tester (test d'intégration) les scripts d'installation chezmoi.

Pistes que j'aimerais étudier :

Todo :

stephane-klein commented 1 year ago

À lire :

stephane-klein commented 1 year ago

J'ai posté ces messages

stephane-klein commented 1 year ago

Je vais commencer à jouer un peu avec https://github.com/89luca89/distrobox

Mes objectifs sont :

stephane-klein commented 1 year ago
$ sudo dnf install distrobox

Je constate que par défaut, distrobox monte le volume home, par conséquent, je dois utiliser :

$ distrobox create --image fedora:37 --name test1 --home ~/distrobox/test1/home
$ distrobox enter test1
stephane-klein commented 1 year ago
$ distrobox create --image fedora:37 --name test1 --home ~/distrobox/test1/home

Je suis surpris, même avec l'option --home... le home de mon hôte est présent dans la distrobox test1.
Ce n'est pas ce que je souhaite, je souhaite un home vide :thinking: .

stephane-klein commented 1 year ago

Ce n'est pas ce que je souhaite, je souhaite un home vide :thinking: .

Via le contenu de cette MR https://github.com/89luca89/distrobox/pull/230, j'ai trouvé l'option --no-workdir de la commande distrobox enter.
Je suis en train de tester si cette option permet bien de ne pas monter le volume home de mon hôte.

stephane-klein commented 1 year ago

Je suis en train de tester si cette option permet bien de ne pas monter le volume home de mon hôte.

Je confirme, cela fonctionne bien :

$ distrobox enter test1 -nw
Container test1 is not running.
Starting container test1
run this command to follow along:

 podman logs -f test1

 Starting container...                           [ OK ]
 Installing basic packages...                    [ OK ]
 Setting up read-only mounts...                  [ OK ]
 Setting up read-write mounts...                 [ OK ]
 Setting up host's sockets integration...        [ OK ]
 Setting up read-only mounts...                  [ OK ]
 Setting up read-write mounts...                 [ OK ]
 Setting up host's sockets integration...        [ OK ]
 Integrating host's themes, icons, fonts...      [ OK ]
 Setting up package manager exceptions...        [ OK ]
 Setting up rpm exceptions...                    [ OK ]
 Setting up sudo...                              [ OK ]
 Setting up groups...                            [ OK ]
 Setting up users...                             [ OK ]
 Integrating host's themes, icons, fonts...      [ OK ]
 Setting up package manager exceptions...        [ OK ]
 Setting up rpm exceptions...                    [ OK ]
 Setting up sudo...                              [ OK ]
 Setting up groups...                            [ OK ]
 Setting up users...                             [ OK ]
 Executing init hooks...                         [ OK ]

Container Setup Complete!
[stephane@test1]~% ls
[stephane@test1]~% ls -lha
total 72K
drwxr-xr-x. 1 stephane stephane 114 Feb 18 10:42 .
drwxr-xr-x. 1 stephane stephane   8 Feb 18 10:41 ..
-rw-r--r--. 1 stephane stephane  18 Feb 18 10:42 .bash_logout
-rw-r--r--. 1 stephane stephane 141 Feb 18 10:42 .bash_profile
-rw-r--r--. 1 stephane stephane 492 Feb 18 10:42 .bashrc
-rw-r--r--. 1 stephane stephane 49K Feb 18 10:42 .zcompdump
-rw-r--r--. 1 stephane stephane 299 Feb 18 10:42 .zprofile
-rw-r--r--. 1 stephane stephane 658 Feb 18 10:42 .zshrc
[stephane@test1]~% touch foobar
stephane-klein commented 1 year ago

Maintenant je vais lancer :

$ sh -c "$(curl -fsLS chezmoi.io/get)" -- init --apply stephane-klein

Dans ma distrobox test1 🤞

stephane-klein commented 1 year ago

Je trouve une première erreur dans mon fichier dotfiles :

Last metadata expiration check: 0:04:12 ago on Sat Feb 18 10:42:20 2023.
Package zsh-5.9-2.fc37.x86_64 is already installed.
Package dnf-plugins-core-4.3.1-1.fc37.noarch is already installed.
No match for argument: starship
Error: Unable to find a match: starship
chezmoi: exit status 1
stephane-klein commented 1 year ago

Je fixe #85

stephane-klein commented 1 year ago

J'ai un problème, les applications Flatpak sont déjà installé dans ma distrobox. Ce n'est pas ce que je souhaite.

stephane-klein commented 1 year ago

Je dois utiliser

$ distrobox create --image fedora:37 --name test1 --home ~/distrobox/test1/home --init-hooks 'umount /var/lib/flatpak'
stephane-klein commented 1 year ago

J'ai maintenant l'erreur :

Complete!

Note that the directory

'/home/stephane/distrobox/test1/home/.local/share/flatpak/exports/share'

is not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

error: Unable to connect to system bus
chezmoi: exit status 1

Je me demande si je ne devrais pas plutôt faire mes scripts de tests dans une VM lancé via kvm ou/et vagrant :thinking:

stephane-klein commented 1 year ago

Je pense que j'ai un playground basé sur libvirt + kvm/qemu avec OpenGL qui fonctionne ici : https://github.com/stephane-klein/virsh-kvm-playground

stephane-klein commented 1 year ago

Lorsque je lance par exemple flatpak install -y flathub org.videolan.VLC dans la VM, j'ai l'erreur suivante :

[vagrant@fedora37 chezmoi]$ flatpak install -y flathub org.videolan.VLC
[vagrant@fedora37 chezmoi]$ flatpak install -y flathub org.videolan.VLC
Looking for matches…
Required runtime for org.videolan.VLC/x86_64/stable (runtime/org.kde.Platform/x86_64/5.15-22.08) found in remote flathub

org.videolan.VLC permissions:
    ipc       network       pulseaudio       x11       devices      file access [1]      dbus access [2]      bus ownership [3]

    [1] host, xdg-config/kdeglobals:ro, xdg-run/gvfs
    [2] com.canonical.AppMenu.Registrar, org.freedesktop.Notifications, org.freedesktop.ScreenSaver, org.freedesktop.secrets, org.kde.KGlobalSettings, org.kde.kconfig.notify,
        org.kde.kwalletd, org.kde.kwalletd5, org.mpris.MediaPlayer2.Player
    [3] org.mpris.MediaPlayer2.vlc

        ID                                Branch               Op          Remote           Download
 1. [✗] org.kde.KStyle.Adwaita            5.15-22.08           i           flathub             6.6 MB / 6.6 MB
 2. [✗] org.kde.Platform.Locale           5.15-22.08           i           flathub            17.9 kB / 354.3 MB
 3. [✗] org.kde.Platform                  5.15-22.08           i           flathub           210.1 MB / 323.9 MB
 4. [ ] org.videolan.VLC.Locale           stable               i           flathub          < 13.4 MB (partial)
 5. [ ] org.videolan.VLC                  stable               i           flathub          < 31.9 MB

Warning: Failed to get revokefs-fuse socket from system-helper: Flatpak system operation GetRevokefsFd not allowed for user
Warning: Flatpak system operation Deploy not allowed for user
Warning: Failed to get revokefs-fuse socket from system-helper: Flatpak system operation GetRevokefsFd not allowed for user
Warning: Flatpak system operation Deploy not allowed for user
Warning: Failed to get revokefs-fuse socket from system-helper: Flatpak system operation GetRevokefsFd not allowed for user
Error: Flatpak system operation Deploy not allowed for user
error: Failed to install org.kde.Platform: Flatpak system operation Deploy not allowed for user

Variables d'env : https://gist.github.com/stephane-klein/249e1b33874affa1b36b39fc8ceaf0db

stephane-klein commented 1 year ago

Je me demande où poser ma question à propos de mon erreur Flatpak :thinking:.

stephane-klein commented 1 year ago

Je me demande où poser ma question à propos de mon erreur Flatpak :thinking:.

La section "Discussions" n'est pas activé sur le projet https://github.com/flatpak/flatpak

Dans un premier temps, je vais poster un message dans https://ask.fedoraproject.org/

stephane-klein commented 1 year ago

J'ai posté ce message https://ask.fedoraproject.org/t/error-flatpak-system-operation-deploy-not-allowed-for-user/32179