From 82633c6f618f940255557e396d286e4cb4e58a1d Mon Sep 17 00:00:00 2001
From: Kay Yan <yankay@users.noreply.github.com>
Date: Fri, 19 May 2023 06:42:33 +0800
Subject: [PATCH] Remove the Support of Debian 9 because  Debian 9 is EOF
 (#10097)

* remove-debian9-support

* Add six module into openstack-cleanup/requirements.txt (#10099)

To fix tf-elastx_cleanup job which was failed with the following error:

   File "/usr/local/lib/python3.11/site-packages/keystoneauth1/identity/generic/password.py", line 16, in <module>
     from keystoneauth1.identity import v3
   File "/usr/local/lib/python3.11/site-packages/keystoneauth1/identity/v3/__init__.py", line 27, in <module>
     from keystoneauth1.identity.v3.oauth2_mtls_client_credential import *  # noqa
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.11/site-packages/keystoneauth1/identity/v3/oauth2_mtls_client_credential.py", line 17, in <module>
     import six
 ModuleNotFoundError: No module named 'six'

---------

Co-authored-by: Kenichi Omichi <ken1ohmichi@gmail.com>
---
 .gitlab-ci/packet.yml                                |  2 +-
 README.md                                            |  2 +-
 docs/ci.md                                           |  5 +----
 roles/bootstrap-os/molecule/default/molecule.yml     |  4 ----
 ...bian9-macvlan.yml => packet_debian10-macvlan.yml} |  2 +-
 tests/scripts/testcases_run.sh                       | 12 ++++++++++++
 6 files changed, 16 insertions(+), 11 deletions(-)
 rename tests/files/{packet_debian9-macvlan.yml => packet_debian10-macvlan.yml} (89%)

diff --git a/.gitlab-ci/packet.yml b/.gitlab-ci/packet.yml
index 844082055..aa9b25d12 100644
--- a/.gitlab-ci/packet.yml
+++ b/.gitlab-ci/packet.yml
@@ -201,7 +201,7 @@ packet_almalinux8-calico-ha-ebpf:
   extends: .packet_pr
   when: manual
 
-packet_debian9-macvlan:
+packet_debian10-macvlan:
   stage: deploy-part2
   extends: .packet_pr
   when: manual
diff --git a/README.md b/README.md
index b0c78eccc..35e5c13e6 100644
--- a/README.md
+++ b/README.md
@@ -142,7 +142,7 @@ vagrant up
 ## Supported Linux Distributions
 
 - **Flatcar Container Linux by Kinvolk**
-- **Debian** Bullseye, Buster, Jessie, Stretch
+- **Debian** Bullseye, Buster
 - **Ubuntu** 16.04, 18.04, 20.04, 22.04
 - **CentOS/RHEL** 7, [8, 9](docs/centos.md#centos-8)
 - **Fedora** 35, 36
diff --git a/docs/ci.md b/docs/ci.md
index 7f6d5ca2d..67d87ff18 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -9,9 +9,8 @@ To generate this Matrix run `./tests/scripts/md-table/main.py`
 almalinux8 |  :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: |
 amazon |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 centos7 |  :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
-debian10 |  :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
+debian10 |  :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
 debian11 |  :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
-debian9 |  :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
 fedora35 |  :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: |
 fedora36 |  :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: |
 opensuse |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
@@ -31,7 +30,6 @@ amazon |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 centos7 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 debian10 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 debian11 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
-debian9 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 fedora35 |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 fedora36 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 opensuse |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
@@ -51,7 +49,6 @@ amazon |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 centos7 |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 debian10 |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 debian11 |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
-debian9 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 fedora35 |  :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
 fedora36 |  :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: |
 opensuse |  :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
diff --git a/roles/bootstrap-os/molecule/default/molecule.yml b/roles/bootstrap-os/molecule/default/molecule.yml
index 8413baae6..22e322ebe 100644
--- a/roles/bootstrap-os/molecule/default/molecule.yml
+++ b/roles/bootstrap-os/molecule/default/molecule.yml
@@ -29,10 +29,6 @@ platforms:
     box: almalinux/8
     cpus: 1
     memory: 512
-  - name: debian9
-    box: generic/debian9
-    cpus: 1
-    memory: 512
   - name: debian10
     box: generic/debian10
     cpus: 1
diff --git a/tests/files/packet_debian9-macvlan.yml b/tests/files/packet_debian10-macvlan.yml
similarity index 89%
rename from tests/files/packet_debian9-macvlan.yml
rename to tests/files/packet_debian10-macvlan.yml
index a65aa9653..fad162e46 100644
--- a/tests/files/packet_debian9-macvlan.yml
+++ b/tests/files/packet_debian10-macvlan.yml
@@ -1,6 +1,6 @@
 ---
 # Instance settings
-cloud_image: debian-9
+cloud_image: debian-10
 mode: default
 
 # Kubespray settings
diff --git a/tests/scripts/testcases_run.sh b/tests/scripts/testcases_run.sh
index a6a9d4d07..4155427ff 100755
--- a/tests/scripts/testcases_run.sh
+++ b/tests/scripts/testcases_run.sh
@@ -47,7 +47,15 @@ if [[ "$CI_JOB_NAME" =~ "ubuntu" ]]; then
   CI_TEST_ADDITIONAL_VARS="-e ansible_python_interpreter=/usr/bin/python3"
 fi
 
+ENABLE_020_TEST="true"
+ENABLE_030_TEST="true"
 ENABLE_040_TEST="true"
+if [[ "$CI_JOB_NAME" =~ "macvlan" ]]; then
+  ENABLE_020_TEST="false"
+  ENABLE_030_TEST="false"
+  ENABLE_040_TEST="false"
+fi
+
 if [[ "$CI_JOB_NAME" =~ "hardening" ]]; then
   # TODO: We need to remove this condition by finding alternative container
   # image instead of netchecker which doesn't work at hardening environments.
@@ -119,10 +127,14 @@ ansible-playbook --limit "all:!fake_hosts" -e @${CI_TEST_VARS} ${CI_TEST_ADDITIO
 ansible-playbook --limit "all:!fake_hosts" -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} tests/testcases/015_check-nodes-ready.yml $ANSIBLE_LOG_LEVEL
 
 ## Test that all pods are Running
+if [ "${ENABLE_020_TEST}" = "true" ]; then
 ansible-playbook --limit "all:!fake_hosts" -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} tests/testcases/020_check-pods-running.yml $ANSIBLE_LOG_LEVEL
+fi
 
 ## Test pod creation and ping between them
+if [ "${ENABLE_030_TEST}" = "true" ]; then
 ansible-playbook --limit "all:!fake_hosts" -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} tests/testcases/030_check-network.yml $ANSIBLE_LOG_LEVEL
+fi
 
 ## Advanced DNS checks
 if [ "${ENABLE_040_TEST}" = "true" ]; then
-- 
GitLab