Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: google-guest-ag...@packages.debian.org, Andrew Jorgensen 
<ajorg...@google.com>, Leandro (Leo) Dorileo <dori...@google.com>
Control: affects -1 + src:google-guest-agent

Please unblock package google-guest-agent

[ Reason ]

google-guest-agent 20211116.00-7 fixes an RC FTBFS bug.  It's a minimal,
targeted change prepared by the upstream maintainers.  We're asking for it to
be unblocked despite not currently being in testing.  It is a leaf package with
little risk of disuption to other packages in the distro.

[ Impact ]

Google-guest-agent is required in order to launch virtual machines on the
Google cloud.  Without it, Debian will be unable to publish functional cloud
images targeting this environment.  Please note that this would *not* be a
regression, as we have not previously published official Debian images to the
Google cloud, but it is a frequent user request, and doing so would reduce
confusion caused by third-parties (including Google themselves) publishing
Debian-like images including additional software.

[ Tests ]

The package runs its unit test suite during the build process, and the salsa
pipeline runs piuparts and lintian as usual.

[ Risks ]

It's a leaf package that's installed on a limited, very specific configuration
(Google cloud VMs).  The change is minimal and targeted.  So I would
characterize this as low risk.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

[ Other info ]

Note that the changelog entries for two NMUs (-6.1 and -6.2) didn't make it in
to the git repository and thus show up as removed in the debdiff.  The actual
changes are present, though.

unblock google-guest-agent/20211116.00-7
diff -Nru google-guest-agent-20211116.00/debian/changelog 
google-guest-agent-20211116.00/debian/changelog
--- google-guest-agent-20211116.00/debian/changelog     2024-08-03 
10:32:11.000000000 -0400
+++ google-guest-agent-20211116.00/debian/changelog     2025-04-17 
14:51:47.000000000 -0400
@@ -1,16 +1,10 @@
-google-guest-agent (20211116.00-6.2) unstable; urgency=medium
+google-guest-agent (20211116.00-7) unstable; urgency=medium
 
-  * Non-maintainer upload.
-  * Build against google/protobuf@v1.5, Closes: #1077779
+  * tests: remove wsfc_test.go
+  * packaging: adjust dependencies (Closes: #1070319)
+  * Enable the gitlab CI pipeline
 
- -- Reinhard Tartler <siret...@tauware.de>  Sat, 03 Aug 2024 10:32:11 -0400
-
-google-guest-agent (20211116.00-6.1) unstable; urgency=medium
-
-  * Non-maintainer upload.
-  * Install all files into /usr. (Closes: #1073661)
-
- -- Chris Hofstaedtler <z...@debian.org>  Thu, 18 Jul 2024 20:34:42 +0200
+ -- Leandro (Leo) Dorileo <dori...@google.com>  Thu, 17 Apr 2025 18:51:47 +0000
 
 google-guest-agent (20211116.00-6) unstable; urgency=medium
 
diff -Nru google-guest-agent-20211116.00/debian/control 
google-guest-agent-20211116.00/debian/control
--- google-guest-agent-20211116.00/debian/control       2024-08-03 
10:32:11.000000000 -0400
+++ google-guest-agent-20211116.00/debian/control       2025-04-17 
14:51:47.000000000 -0400
@@ -1,6 +1,6 @@
 Source: google-guest-agent
 Maintainer: Debian Cloud Team <debian-cl...@lists.debian.org>
-Uploaders: Michael Banck <mba...@debian.org>
+Uploaders: Michael Banck <mba...@debian.org>, Leandro (Leo) Dorileo 
<dori...@google.com>
 Section: golang
 Testsuite: autopkgtest-pkg-go
 Priority: optional
@@ -11,10 +11,8 @@
                golang-github-golang-groupcache-dev,
                golang-github-kardianos-service-dev,
                golang-github-tarm-serial-dev,
-               golang-google-cloud-dev,
                golang-github-googlecloudplatform-guest-logging-go-dev,
-               golang-google-grpc-dev,
-               golang-github-golang-protobuf-1-5-dev
+               golang-google-grpc-dev
 Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/cloud-team/google-guest-agent
 Vcs-Git: https://salsa.debian.org/cloud-team/google-guest-agent.git
diff -Nru google-guest-agent-20211116.00/debian/gitlab-ci.yml 
google-guest-agent-20211116.00/debian/gitlab-ci.yml
--- google-guest-agent-20211116.00/debian/gitlab-ci.yml 2024-08-03 
10:32:11.000000000 -0400
+++ google-guest-agent-20211116.00/debian/gitlab-ci.yml 1969-12-31 
19:00:00.000000000 -0500
@@ -1,26 +0,0 @@
-# auto-generated, DO NOT MODIFY.
-# The authoritative copy of this file lives at:
-# https://salsa.debian.org/go-team/ci/blob/master/config/gitlabciyml.go
-
-image: stapelberg/ci2
-
-test_the_archive:
-  artifacts:
-    paths:
-    - before-applying-commit.json
-    - after-applying-commit.json
-  script:
-    # Create an overlay to discard writes to /srv/gopath/src after the build:
-    - "rm -rf /cache/overlay/{upper,work}"
-    - "mkdir -p /cache/overlay/{upper,work}"
-    - "mount -t overlay overlay -o 
lowerdir=/srv/gopath/src,upperdir=/cache/overlay/upper,workdir=/cache/overlay/work
 /srv/gopath/src"
-    - "export GOPATH=/srv/gopath"
-    - "export GOCACHE=/cache/go"
-    # Build the world as-is:
-    - "ci-build -exemptions=/var/lib/ci-build/exemptions.json > 
before-applying-commit.json"
-    # Copy this package into the overlay:
-    - "GBP_CONF_FILES=:debian/gbp.conf gbp buildpackage --git-no-pristine-tar 
--git-ignore-branch --git-ignore-new --git-export-dir=/tmp/export 
--git-no-overlay --git-tarball-dir=/nonexistant --git-cleaner=/bin/true 
--git-builder='dpkg-buildpackage -S -d --no-sign'"
-    - "pgt-gopath -dsc /tmp/export/*.dsc"
-    # Rebuild the world:
-    - "ci-build -exemptions=/var/lib/ci-build/exemptions.json > 
after-applying-commit.json"
-    - "ci-diff before-applying-commit.json after-applying-commit.json"
diff -Nru google-guest-agent-20211116.00/debian/patches/debian-changes 
google-guest-agent-20211116.00/debian/patches/debian-changes
--- google-guest-agent-20211116.00/debian/patches/debian-changes        
2024-08-03 10:32:11.000000000 -0400
+++ google-guest-agent-20211116.00/debian/patches/debian-changes        
2025-04-17 14:51:47.000000000 -0400
@@ -83,6 +83,275 @@
  KillMode=process
  
  [Install]
+diff --git a/google_guest_agent/wsfc_test.go b/google_guest_agent/wsfc_test.go
+deleted file mode 100644
+index f5a9ae2..0000000
+--- a/google_guest_agent/wsfc_test.go
++++ /dev/null
+@@ -1,263 +0,0 @@
+-//  Copyright 2017 Google Inc. All Rights Reserved.
+-//
+-//  Licensed under the Apache License, Version 2.0 (the "License");
+-//  you may not use this file except in compliance with the License.
+-//  You may obtain a copy of the License at
+-//
+-//      http://www.apache.org/licenses/LICENSE-2.0
+-//
+-//  Unless required by applicable law or agreed to in writing, software
+-//  distributed under the License is distributed on an "AS IS" BASIS,
+-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-//  See the License for the specific language governing permissions and
+-//  limitations under the License.
+-
+-package main
+-
+-import (
+-      "bufio"
+-      "errors"
+-      "fmt"
+-      "net"
+-      "reflect"
+-      "testing"
+-
+-      "github.com/go-ini/ini"
+-)
+-
+-func setEnableWSFC(md metadata, enabled *bool) *metadata {
+-      md.Instance.Attributes.EnableWSFC = enabled
+-      return &md
+-}
+-
+-func setWSFCAddresses(md metadata, wsfcAddresses string) *metadata {
+-      md.Instance.Attributes.WSFCAddresses = wsfcAddresses
+-      return &md
+-}
+-
+-func setWSFCAgentPort(md metadata, wsfcPort string) *metadata {
+-      md.Instance.Attributes.WSFCAgentPort = wsfcPort
+-      return &md
+-}
+-
+-var (
+-      testAgent    = getWsfcAgentInstance()
+-      testMetadata = metadata{}
+-      testListener = &net.TCPListener{}
+-)
+-
+-func TestNewWsfcManager(t *testing.T) {
+-      type args struct {
+-              newMetadata *metadata
+-      }
+-      tests := []struct {
+-              name string
+-              args args
+-              want *wsfcManager
+-      }{
+-              {"empty meta config", args{&testMetadata}, 
&wsfcManager{agentNewState: stopped, agentNewPort: wsfcDefaultAgentPort, agent: 
testAgent}},
+-              {"wsfc enabled", args{setEnableWSFC(testMetadata, 
mkptr(true))}, &wsfcManager{agentNewState: running, agentNewPort: 
wsfcDefaultAgentPort, agent: testAgent}},
+-              {"wsfc addrs is set", args{setWSFCAddresses(testMetadata, 
"0.0.0.0")}, &wsfcManager{agentNewState: running, agentNewPort: 
wsfcDefaultAgentPort, agent: testAgent}},
+-              {"wsfc port is set", args{setWSFCAgentPort(testMetadata, 
"1818")}, &wsfcManager{agentNewState: stopped, agentNewPort: "1818", agent: 
testAgent}},
+-      }
+-      config = ini.Empty()
+-      for _, tt := range tests {
+-              newMetadata = tt.args.newMetadata
+-              if got := newWsfcManager(); !reflect.DeepEqual(got, tt.want) {
+-                      t.Errorf("test case %q: newWsfcManager() = %v, want 
%v", tt.name, got, tt.want)
+-              }
+-      }
+-}
+-
+-func TestWsfcManagerDiff(t *testing.T) {
+-      tests := []struct {
+-              name string
+-              m    *wsfcManager
+-              want bool
+-      }{
+-              {"state change from stop to running", 
&wsfcManager{agentNewState: running, agent: &wsfcAgent{listener: nil}}, true},
+-              {"state change from running to stop", 
&wsfcManager{agentNewState: stopped, agent: &wsfcAgent{listener: 
testListener}}, true},
+-              {"port changed", &wsfcManager{agentNewPort: "1818", agent: 
&wsfcAgent{port: wsfcDefaultAgentPort}}, true},
+-              {"state does not change both running", 
&wsfcManager{agentNewState: running, agent: &wsfcAgent{listener: 
testListener}}, false},
+-              {"state does not change both stopped", 
&wsfcManager{agentNewState: stopped, agent: &wsfcAgent{listener: nil}}, false},
+-      }
+-      for _, tt := range tests {
+-              if got := tt.m.diff(); got != tt.want {
+-                      t.Errorf("test case %q: wsfcManager.diff() = %v, want 
%v", tt.name, got, tt.want)
+-              }
+-
+-      }
+-}
+-
+-// Mock health agent for unit testing
+-type mockAgent struct {
+-      state       agentState
+-      port        string
+-      runError    bool
+-      stopError   bool
+-      runInvoked  bool
+-      stopInvoked bool
+-}
+-
+-func (a *mockAgent) getState() agentState {
+-      return a.state
+-}
+-
+-func (a *mockAgent) getPort() string {
+-      return a.port
+-}
+-
+-func (a *mockAgent) setPort(newPort string) {
+-      a.port = newPort
+-}
+-
+-func (a *mockAgent) run() error {
+-      a.runInvoked = true
+-      if a.runError {
+-              return errors.New("Run error")
+-      }
+-
+-      a.state = running
+-      return nil
+-}
+-
+-func (a *mockAgent) stop() error {
+-      a.stopInvoked = true
+-      if a.stopError {
+-              return errors.New("Stop error")
+-      }
+-
+-      a.state = stopped
+-      return nil
+-}
+-
+-func TestWsfcManagerSet(t *testing.T) {
+-      tests := []struct {
+-              name        string
+-              m           *wsfcManager
+-              wantErr     bool
+-              runInvoked  bool
+-              stopInvoked bool
+-      }{
+-              {"set start agent", &wsfcManager{agentNewState: running, agent: 
&mockAgent{state: stopped}}, false, true, false},
+-              {"set start agent error", &wsfcManager{agentNewState: running, 
agent: &mockAgent{state: stopped, runError: true}}, true, true, false},
+-              {"set stop agent", &wsfcManager{agentNewState: stopped, agent: 
&mockAgent{state: running}}, false, false, true},
+-              {"set stop agent error", &wsfcManager{agentNewState: stopped, 
agent: &mockAgent{state: running, stopError: true}}, true, false, true},
+-              {"set restart agent", &wsfcManager{agentNewState: running, 
agentNewPort: "1", agent: &mockAgent{state: running, port: "0"}}, false, true, 
true},
+-              {"set restart agent stop error", &wsfcManager{agentNewState: 
running, agentNewPort: "1", agent: &mockAgent{state: running, port: "0", 
stopError: true}}, true, false, true},
+-              {"set restart agent start error", &wsfcManager{agentNewState: 
running, agentNewPort: "1", agent: &mockAgent{state: running, port: "0", 
runError: true}}, true, true, true},
+-              {"set do nothing", &wsfcManager{agentNewState: stopped, 
agentNewPort: "1", agent: &mockAgent{state: stopped, port: "0"}}, false, false, 
false},
+-      }
+-      for _, tt := range tests {
+-              if err := tt.m.set(); (err != nil) != tt.wantErr {
+-                      t.Errorf("wsfcManager.set() error = %v, wantErr %v", 
err, tt.wantErr)
+-              }
+-
+-              mAgent := tt.m.agent.(*mockAgent)
+-              if gotRunInvoked := mAgent.runInvoked; gotRunInvoked != 
tt.runInvoked {
+-                      t.Errorf("wsfcManager.set() runInvoked = %v, want %v", 
gotRunInvoked, tt.runInvoked)
+-              }
+-
+-              if gotStopInvoked := mAgent.stopInvoked; gotStopInvoked != 
tt.stopInvoked {
+-                      t.Errorf("wsfcManager.set() stopInvoked = %v, want %v", 
gotStopInvoked, tt.stopInvoked)
+-              }
+-
+-              if tt.m.agentNewPort != mAgent.port {
+-                      t.Errorf("wsfcManager.set() does not set prot, agent 
port = %v, want %v", mAgent.port, tt.m.agentNewPort)
+-              }
+-      }
+-}
+-
+-func getHealthCheckResponce(request string, agent healthAgent) (string, 
error) {
+-      serverAddr := "localhost:" + agent.getPort()
+-      conn, err := net.Dial("tcp", serverAddr)
+-      if err != nil {
+-              return "", err
+-      }
+-      defer closer(conn)
+-
+-      fmt.Fprint(conn, request)
+-      return bufio.NewReader(conn).ReadString('\n')
+-}
+-
+-func TestWsfcRunAgentE2E(t *testing.T) {
+-
+-      wsfcMgr := &wsfcManager{agentNewState: running, agentNewPort: 
wsfcDefaultAgentPort, agent: getWsfcAgentInstance()}
+-      wsfcMgr.set()
+-
+-      // make sure the agent is cleaned up.
+-      defer wsfcMgr.agent.stop()
+-
+-      addrs, err := net.InterfaceAddrs()
+-      if err != nil {
+-              t.Fatal("getting localing interface failed.")
+-      }
+-
+-      // pick first local ip that is not lookback ip
+-      var existIP string
+-      for _, addr := range addrs {
+-              if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() 
{
+-                      existIP = ipnet.IP.To4().String()
+-                      break
+-              }
+-      }
+-
+-      // test with existing IP
+-      if got, err := getHealthCheckResponce(existIP, wsfcMgr.agent); got != 
"1" {
+-              t.Errorf("health check failed with %v, got = %v, want %v", 
existIP, got, "1")
+-              if err != nil {
+-                      t.Error(err)
+-              }
+-      }
+-
+-      // test an invalid ip which could not exist
+-      invalidIP := "255.255.255.256"
+-      if got, err := getHealthCheckResponce(invalidIP, wsfcMgr.agent); got != 
"0" {
+-              t.Errorf("health check failed with %v, got = %v, want %v", 
invalidIP, got, "0")
+-              if err != nil {
+-                      t.Error(err)
+-              }
+-      }
+-
+-      // test stop agent
+-      wsfcMgrStop := &wsfcManager{agentNewState: stopped, agent: 
getWsfcAgentInstance()}
+-      wsfcMgrStop.set()
+-      if _, err := getHealthCheckResponce(existIP, wsfcMgr.agent); err == nil 
{
+-              t.Errorf("health check still running after calling stop")
+-      }
+-}
+-
+-func TestInvokeRunOnRunningWsfcAgent(t *testing.T) {
+-      agent := &wsfcAgent{listener: testListener}
+-
+-      if err := agent.run(); err != nil {
+-              t.Errorf("Invoke run on running agent, error = %v, want = %v", 
err, nil)
+-      }
+-}
+-
+-func TestInvokeStopOnStoppedWsfcAgent(t *testing.T) {
+-      agent := &wsfcAgent{listener: nil}
+-
+-      if err := agent.stop(); err != nil {
+-              t.Errorf("Invoke stop on stopped agent, error = %v, want = %v", 
err, nil)
+-      }
+-}
+-
+-func TestWsfcAgentSetPort(t *testing.T) {
+-      want := "2"
+-      agent := &wsfcAgent{port: "1"}
+-      agent.setPort(want)
+-
+-      if agent.port != want {
+-              t.Errorf("WsfcAgent.setPort() port = %v, want %v", agent.port, 
want)
+-      }
+-}
+-
+-func TestGetWsfcAgentInstance(t *testing.T) {
+-      agentFirst := getWsfcAgentInstance()
+-      agentSecond := getWsfcAgentInstance()
+-
+-      if agentFirst != agentSecond {
+-              t.Errorf("getWsfcAgentInstance is not returning same instance")
+-      }
+-}
 diff --git a/instance_configs.cfg b/instance_configs.cfg
 index b515cf8..3005173 100644
 --- a/instance_configs.cfg
diff -Nru google-guest-agent-20211116.00/debian/salsa-ci.yml 
google-guest-agent-20211116.00/debian/salsa-ci.yml
--- google-guest-agent-20211116.00/debian/salsa-ci.yml  1969-12-31 
19:00:00.000000000 -0500
+++ google-guest-agent-20211116.00/debian/salsa-ci.yml  2025-04-17 
14:51:47.000000000 -0400
@@ -0,0 +1,3 @@
+---
+include:
+  - 
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml

Reply via email to