Skip to content

Instantly share code, notes, and snippets.

@freyes
Last active September 21, 2023 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freyes/ca4d5861551dc1019ae66f564079d88f to your computer and use it in GitHub Desktop.
Save freyes/ca4d5861551dc1019ae66f564079d88f to your computer and use it in GitHub Desktop.

Steps to test:

  1. Setup model-default to always include the ppa
    cat << EOF > model-config.yaml
    #cloud-config
    apt:
      sources:
        lp2023211:
          source: 'ppa:freyes/lp2023211'
    EOF
    juju model-default cloudinit-userdata=@./model-config.yaml
    
  2. Clone c-o-t:
    git clone https://github.com/openstack-charmers/charmed-openstack-tester.git
    
  3. Create a new model: juju add-model jammy-yoga
  4. Verify the cloudinit-userdata was set correctly: juju model-config cloudinit-userdata
  5. Load env variables: source ~/novarc
  6. Create the func-target env running tox -e func-target -- --help
  7. Activate the created environment: source ./.func-target/bin/activate
  8. Cd into the distro-regression directory: cd ./tests/distro-regression/
  9. Start the deployment: functest-deploy -m jammy-yoga -b ./tests/bundles/jammy-yoga.yaml
  10. Check that the PPA was used to do the deployment:
    juju run -a nova-cloud-controller "apt policy nova-common"
    juju run -a nova-compute "apt policy nova-common"
    
  11. Configure the cloud: functest-configure -m keystone_v3_smoke_focal:jammy-yoga
  12. Run tempest: functest-test -m keystone_v3_smoke_focal:jammy-yoga 2>&1 | tee tempest-ppa.log
  13. Downgrade the nova packages:
    juju ssh nova-cloud-controller/0 sudo apt-get install nova-common=3:25.2.0-0ubuntu1
    juju ssh nova-compute/N sudo apt-get install nova-common=3:25.2.0-0ubuntu1
    
  14. Toggle debug to force the restart of services
    juju config nova-cloud-controller debug=true
    juju config nova-compute debug=true
    
  15. Re-run tempest: functest-test -m keystone_v3_smoke_focal:jammy-yoga 2>&1 | tee tempest-downgraded.log
@jadonn
Copy link

jadonn commented Sep 20, 2023

When I tried to configure cloudinit-userdata in step 1, I got errors like:

$ juju model-config cloudinit-userdata=@./model-config.yaml
ERROR cloudinit-userdata: must be valid YAML: yaml: found character that cannot start any token

I was able to input the configuration though by rewriting the YAML like so:

#cloud-config
cloudinit-userdata: |
  apt:
    sources:
      lp2023211:
        source: ppa:freyes/lp2023211

and then I ran juju model-config ./model-config.yaml. The model config was then set in Juju as far as I can tell:

$ juju model-config cloudinit-userdata
apt:
  sources:
    lp2023211:
      source: ppa:freyes/lp2023211

@jadonn
Copy link

jadonn commented Sep 20, 2023

I do realize now I had to rerun those steps after I made a new model since I didn't use juju model-defaults. That's an oversight on my part.

@jadonn
Copy link

jadonn commented Sep 20, 2023

I had no problems up to step 7. I needed to run source .tox/func-target/bin/activate to activate the func-target virtual environment insatead of source ./.func-target/bin/activate.

@jadonn
Copy link

jadonn commented Sep 21, 2023

When I tried running functest-deploy -m keystone_v3_smoke_focal:jammy-yoga -b ./tests/bundles/jammy-yoga.yaml in step 9, I received the error:

2023-09-21 00:02:57 [ERROR] Template error. You may be missing a mandatory environment variable : 'TEST_GATEWAY' is undefined

I fixed this by sourcing the variables from the charmed-openstack-tester repo. These variables in particular:

export TEST_HTTP_PROXY=http://squid.internal:3128
export TEST_FIP_RANGE=10.5.150.0:10.5.200.254
export TEST_CIDR_EXT=10.5.0.0/16
export TEST_GATEWAY=10.5.0.1
export TEST_NAME_SERVER=10.245.168.6
export TEST_CIDR_PRIV=192.168.21.0/24
export TEST_SWIFT_IP=10.245.161.162

I wanted to mention this in case this step needed to be added to the list of steps.

@jadonn
Copy link

jadonn commented Sep 21, 2023

In step 9 when I tried to run functest-deploy -m keystone_v3_smoke_focal:jammy-yoga -b ./tests/bundles/jammy-yoga.yaml, I got the following errors:

2023-09-21 00:06:48 [INFO] ERROR controller keystone_v3_smoke_focal not found

The command then failed. I tried again with functest-deploy -m jammy-yoga -b ./tests/bundles/jammy-yoga.yaml - so dropping the keystone_v3_smoke_focal part in the model argument, and that seems to be working so far. I have a deployment running using the jammy-yoga.yaml bundle. It will probably take a bit to run. I will report back probably tomorrow on what happens with the deployment.

@freyes
Copy link
Author

freyes commented Sep 21, 2023

#cloud-config
cloudinit-userdata: |
[...]

you need to swap those 2 lines, #cloud-config needs to be part of the string passed to cloudinit-userdata, it should look like this:

cloudinit-userdata: |
  #cloud-config
  apt:
    sources:
      lp2023211:
        source: ppa:freyes/lp2023211

@freyes
Copy link
Author

freyes commented Sep 21, 2023

In step 9 when I tried to run functest-deploy -m keystone_v3_smoke_focal:jammy-yoga -b ./tests/bundles/jammy-yoga.yaml, I got the following errors:

2023-09-21 00:06:48 [INFO] ERROR controller keystone_v3_smoke_focal not found

The command then failed. I tried again with functest-deploy -m jammy-yoga -b ./tests/bundles/jammy-yoga.yaml - so dropping the keystone_v3_smoke_focal part in the model argument, and that seems to be working so far. I have a deployment running using the jammy-yoga.yaml bundle. It will probably take a bit to run. I will report back probably tomorrow on what happens with the deployment.

ah, yes, drop that was the right thing to do, I will amend the instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment