goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.55k stars 473 forks source link

http query #744

Closed Staggerlee011 closed 2 years ago

Staggerlee011 commented 2 years ago

Hi, i have a simple flask app,

it tries to query external resources (AWs s3 bucket). When it connects successfully to the external resources, i get a page saying s3 test and some details and when it doesnt i get a page with the exception details.

I wanted to run a simple a test of:

  http://localhost/s3:
    status: 200
    timeout: 5000
    body: 
      - S3 test

But even with it fails to connect im getting a pgoss passing test? Any idea why?

App code below if that helps

Flask app.py:

@app.route('/s3/')
def s3():
    try:
        s3 = boto3.resource('s3')
        buckets = s3.buckets.all()
        return render_template('s3.html', buckets=buckets )
    except Exception as e:
            return str(e)

s3.html

<h1>S3 test</h1>

<p>
    This is test app to show pulling data from AWS (specifically s3) via IAM credentials
</p>

<table>
    <tr>
        <th>Names</th>
    </tr>
    {% for bucket in buckets %}
    <tr>
       <td> {{ bucket.name }} </td>
    </tr>

    {% endfor %}
 </table>
Staggerlee011 commented 2 years ago

EBKAC

error on my side.. its working as expected now.