Navigation

    SOFTWARE TESTING

    • Register
    • Login
    • Search
    • Job Openings
    • Freelance Jobs
    • Companies
    • Conferences
    • Courses
    1. Home
    2. chanisef
    C
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    chanisef

    @chanisef

    1
    Reputation
    29955
    Posts
    3
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    chanisef Follow

    Best posts made by chanisef

    • How to get logs with failed tests from the server (pytest)?

      I want to pull logs from the server, if the test ended up with FAILED status, tell me please what the signature of a function or fixture should look like, which will be called after each test and have information about its status.

      I run the script like this

      py.test -s -vv -l --alluredir allure / main.py
      
      posted in Automated Testing
      C
      chanisef

    Latest posts made by chanisef

    • RE: How to create, but not overwrite, a file and manage its permissions with ansible?

      The most obvious candidate to this task is ansible.builtin.file with state: touch.

      Right, this could be an option.

      However, it always appears as changed as the times need to be updated.

      According the documentation https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html#parameters not necessarily since access_time and modification_time

      Should be preserve when no modification is required

      The following minimal example

      ---
      - hosts: localhost
        become: false
        gather_facts: false
      

      tasks:

      • name: Create file
        file:
        path: "/home/{{ ansible_user }}/test.file"
        owner: "{{ ansible_user }}"
        group: "users"
        access_time: preserve
        modification_time: preserve
        state: touch

      • name: Touch again
        file:
        path: "/home/{{ ansible_user }}/test.file"
        owner: "{{ ansible_user }}"
        group: "users"
        access_time: preserve
        modification_time: preserve
        state: touch

      will result into an output of

      TASK [Create file] ***************************
      changed: [localhost]
      

      TASK [Touch again] ***************************
      ok: [localhost]

      PLAY RECAP ***********************************
      localhost : ok=2 changed=1

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • Terraform conditional block inside a map

      I have an https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function resource like below:

      resource "aws_lambda_function" "mylambda" {
      
      #...
      
      environment {
          variables = {
              FOO = 1
          }
      }
      

      }

      I'm tring to add some environment variables dynamically based on my var.enable_vars

      variable "enable_vars" {
        type        = bool
        default     = false
      }
      

      resource "aws_lambda_function" "mylambda" {

      #...
      
      environment {
          variables = {
              FOO = 1
      #### if var.enable_vars == true
      #       BAR = 2
      #       BAZ = 3
          }
      }
      

      }

      How to achieve that? Is not clear to me if a dynamic block can be used there.

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • RE: Is there a safe way to archive Azure App Services application settings?

      Ideally, you would be injecting these via an appsettings.json, Key Vault reference or something and not manually setting these in the Configuration panel itself. In terms of archiving the actual values etc, this is probably most easily accomplished via the https://learn.microsoft.com/en-us/rest/api/appservice/web-apps . There are several CRUD operations that can GET, UPDATE, etc configurations/application settings which should be able to allow you to accomplish what you have asked here.

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • Why does stripping executables in Docker add ridiculous layer memory overhead?

      On https://github.com/T145/black-mirror/blob/master/Dockerfile#L55 , I ran the following command to reduce executable sizes:

      find -P -O3 /usr/bin/ /usr/local/bin -type f -not -name strip -and -not -name dbus-daemon -execdir strip -v --strip-unneeded '{}' \;
      

      And its size jumped up from ~779.53 to ~986.55MB!

      As an attempt to bypass this caveat I created an intermediate layer to copy the changes over from, like so:

      FROM base as stripped
      

      RUN find -P -O3 /usr/bin/ /usr/local/bin -type f -not -name strip -and -not -name dbus-daemon -execdir strip -v --strip-unneeded '{}' ;

      FROM base

      COPY --from=stripped /usr/bin/ /usr/bin/
      COPY --from=stripped /usr/local/bin/ /usr/local/bin/

      However the resulting image size did not change. Also note that the base image has other programs installed on it, so simply using another Debian distribution as the intermediate layer wouldn't cover stripping each program on the base image.

      Why is this large size difference happening? Is there a way to strip executables in Docker at all without having this happen?

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • Variable for Terraform Workspace name?

      When I run terraform apply in a new workspace, I get

      openstack_networking_port_secgroup_associate_v2.network_project_k3s: Creation complete after 1s [id=4543b73b-541e-40c3-a311-5b1f553b9d58]
      ╷
      │ Error: Error trying to get network information from the Network API: More than one network found for name net_project
      │ 
      │   with openstack_compute_instance_v2.test-server,
      │   on main.tf line 137, in resource "openstack_compute_instance_v2" "test-server":
      │  137: resource "openstack_compute_instance_v2" "test-server" {
      

      I suppose I'm getting this because OpenStack's network names are globally unique. How can I incorporate the workspace name in the network name?

      resource "openstack_networking_network_v2" "net_project" {
        name           = "net_project_${WORKSPACE}"
        admin_state_up = "true"
      }
      
      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • RE: What permission is required to deploy release?

      Found it!

      The permissions are set on each release pipeline itself:

      enter image description here

      "Manage Deployments" allows users to come in and deploy to their environment without allowing them to edit the pipeline.

      enter image description here

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • How to fetch azure secret if exist in KV using terraform

      I am using below terraform code for fetch azure secret and this is working fine when secret is exist in the azure KV.

      Getting error when secret is not available in KV.

      data "azurerm_key_vault_secret" "win_admin_pass" {
          name         = "${var.secret_name}"
          key_vault_id = "${data.azurerm_key_vault.keyvault.id}"
      }
      

      In my case, this secret may available or may not available.

      How can we ignore error for this particular task when secret not available, or how can we check if secret exist or not, based on this condition we can fetch and ignore set of code?

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • RE: kubernetes daemonset fails to pull docker image from the cluster

      One way to fix this if that's allowed is by setting insecure-registries on the host's docker config:

      sudo cat /etc/docker/daemon.json
      

      {
      "insecure-registries" : [ "10.10.10.10:5000" ]
      }

      restart docker daemon after this

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • RE: How do I get k3s to authenticate with Docker Hub?
      1. Update your /etc/rancher/k3s/registries.yaml to
        configs:
          registry-1.docker.io:
            auth:
              username: evancarroll
              password: TOKENHIDDEN
        
      2. Restart k3s, sudo systemctl force-reload k3s.

      You can confirm the changes were accepted by checking that your key exists in /var/lib/rancher/k3s/agent/etc/containerd/config.toml.

      posted in Continuous Integration and Delivery (CI
      C
      chanisef
    • RE: KubeApps: Invalid GetAvailablePackageSummaries response from the plugin helm.packages: ... Unable to fetch chart categories

      Upstream Answer -- Networking Problem.

      Though I'm getting this on a fresh install I was guided to this which indicates a bigger problem,

      kubectl -n kubeapps exec deployment/kubeapps -- curl -sI https://charts.bitnami.com/bitnami/index.yaml
      

      this returns "command terminated with exit code 6".

      I can further identify the problem with nslookup, without using Kube Apps by following the [k3s tutorial on troubleshooting dns] https://rancher.com/docs/rancher/v2.5/en/troubleshooting/dns/ )

      kubectl run -it --rm --restart=Never busybox --image=busybox:1.28 -- nslookup www.google.com
      

      Follow up

      Now that I know what this problem is (with external DNS resolution), I've asked this question for more information https://devops.stackexchange.com/questions/16161/newly-installed-k3s-cluster-on-fresh-os-install-can-not-resolve-external-domains

      posted in Continuous Integration and Delivery (CI
      C
      chanisef