diff --git a/.drone.yml b/.drone.yml index 447d09358e81..54482bcaafc6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -649,7 +649,7 @@ steps: UPGRADE_CHANNEL="latest" fi fi - E2E_RELEASE_CHANNEL=$UPGRADE_CHANNEL go test -v -timeout=45m ./upgradecluster_test.go -ci -local + E2E_RELEASE_CHANNEL=$UPGRADE_CHANNEL go test -v -timeout=45m ./upgradecluster_test.go -ci -local -ginkgo.v cp ./coverage.out /tmp/artifacts/upgrade-coverage.out fi - docker stop registry && docker rm registry diff --git a/.github/actions/vagrant-setup/action.yaml b/.github/actions/vagrant-setup/action.yaml index 37f268809e20..74a1a1ce2814 100644 --- a/.github/actions/vagrant-setup/action.yaml +++ b/.github/actions/vagrant-setup/action.yaml @@ -8,17 +8,15 @@ runs: run: | curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list - sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list - name: Install vagrant and libvirt shell: bash run: | sudo apt-get update - sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant + sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant=2.4.1-1 ruby-libvirt sudo systemctl enable --now libvirtd - - name: Build vagrant dependencies + - name: Install vagrant dependencies shell: bash run: | - sudo apt-get build-dep -y vagrant ruby-libvirt sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev # This is a workaround for the libvirt group not being available in the current shell # https://github.com/actions/runner-images/issues/7670#issuecomment-1900711711 @@ -26,8 +24,6 @@ runs: shell: bash run: | sudo chmod a+rw /var/run/libvirt/libvirt-sock - - - name: Install vagrant-libvirt plugin shell: bash run: vagrant plugin install vagrant-libvirt \ No newline at end of file diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 56b1328a1e01..3f8f41da58bf 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -9,6 +9,7 @@ on: - "!tests/e2e**" - "!tests/docker**" - ".github/**" + - "!.github/actions/**" - "!.github/workflows/e2e.yaml" pull_request: paths-ignore: @@ -19,6 +20,7 @@ on: - "!tests/e2e**" - "!tests/docker**" - ".github/**" + - "!.github/actions/**" - "!.github/workflows/e2e.yaml" workflow_dispatch: {} @@ -33,7 +35,7 @@ jobs: e2e: name: "E2E Tests" needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 40 strategy: fail-fast: false diff --git a/.github/workflows/unitcoverage.yaml b/.github/workflows/unitcoverage.yaml index 5bbc00f2acce..33b42431ff15 100644 --- a/.github/workflows/unitcoverage.yaml +++ b/.github/workflows/unitcoverage.yaml @@ -28,7 +28,7 @@ permissions: jobs: test: name: Unit Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 20 steps: - name: Checkout diff --git a/pkg/flock/flock_unix.go b/pkg/flock/flock_unix.go index 49b5465bced5..eb4253aa2621 100644 --- a/pkg/flock/flock_unix.go +++ b/pkg/flock/flock_unix.go @@ -19,9 +19,6 @@ limitations under the License. package flock import ( - "os/exec" - "strings" - "golang.org/x/sys/unix" ) @@ -49,14 +46,3 @@ func AcquireShared(path string) (int, error) { func Release(lock int) error { return unix.Flock(lock, unix.LOCK_UN) } - -// CheckLock checks whether any process is using the lock -func CheckLock(path string) bool { - lockByte, _ := exec.Command("lsof", "-w", "-F", "ln", path).Output() - locks := string(lockByte) - if locks == "" { - return false - } - readWriteLock := strings.Split(locks, "\n")[2] - return readWriteLock == "lR" || readWriteLock == "lW" -} diff --git a/pkg/flock/flock_unix_test.go b/pkg/flock/flock_unix_test.go index a47015fa17a1..7eb8794aea85 100644 --- a/pkg/flock/flock_unix_test.go +++ b/pkg/flock/flock_unix_test.go @@ -19,9 +19,22 @@ limitations under the License. package flock import ( + "os/exec" + "strings" "testing" ) +// checkLock checks whether any process is using the lock +func checkLock(path string) bool { + lockByte, _ := exec.Command("lsof", "-w", "-F", "lfn", path).Output() + locks := string(lockByte) + if locks == "" { + return false + } + readWriteLock := strings.Split(locks, "\n")[2] + return readWriteLock == "lR" || readWriteLock == "lW" +} + func Test_UnitFlock(t *testing.T) { tests := []struct { name string @@ -45,7 +58,7 @@ func Test_UnitFlock(t *testing.T) { return } - if got := CheckLock(tt.path); got != tt.wantCheck { + if got := checkLock(tt.path); got != tt.wantCheck { t.Errorf("CheckLock() = %+v\nWant = %+v", got, tt.wantCheck) } @@ -53,7 +66,7 @@ func Test_UnitFlock(t *testing.T) { t.Errorf("Release() error = %v, wantErr %v", err, tt.wantErr) } - if got := CheckLock(tt.path); got == tt.wantCheck { + if got := checkLock(tt.path); got == tt.wantCheck { t.Errorf("CheckLock() = %+v\nWant = %+v", got, !tt.wantCheck) } })