GithubHelp home page GithubHelp logo

vaibhavguptaiitd / aws-mock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from treelogic-swe/aws-mock

0.0 2.0 0.0 3.15 MB

Easily and automatically test essential AWS services with the language-agnostic aws-mock.

Home Page: https://github.com/treelogic-swe/aws-mock/wiki/User's-Guide

License: MIT License

Shell 0.61% JavaScript 10.07% Java 87.70% HTML 1.63%

aws-mock's Introduction

aws-mock automated testing Build Status

Overview

Easily test essential AWS services with the lightweight, very modular aws-mock. Works with official aws-sdk, api-tools and third-party tools. Completely and safely automates the testing process of AWS services in a mock EC2 environment, using http to expose the API.

Readily accessible: Ready-to-run examples included for NodeJS and Java. aws-mock is available as a package from npmjs.org and from maven.org.

Aws-mock currently features the following implemented interfaces of Amazon EC2:

  • describeImages
  • runInstances
  • stopInstances
  • startInstances
  • terminateInstances
  • describeInstances

This mock can manage a huge amount of EC2 instances, making it super easy for you to test your applications.

aws-mock is a pure servlet web application, conforming to the protocols described in the WSDL defined by AWS. Contributions in any JVM-targeting language are welcome.

How It Works

Taking for example the ec2 interface that aws-mock supports (the ec2-endpoint mock), this mock processes Query Requests built by your client.

It then manages the internal mock EC2 instances as an emulation of the lifecycle of those in genuine EC2 (pending->running, stopping->stopped, terminated, etc).

In response it then returns an xml result body which is recognized by your client.

Note: At this time, the only interfaces that have been implemented are the ones listed above. Only essential data fields in the response body are filled.

Inside aws-mock, the mock EC2 instances can work in their own program threads and behave just like real ones. Thus, by extending aws-mock, it would be easy for you to add any custom behavior that you desire to your mock EC2 instances (e.g. insert 'agents' that send heartbeat pings to your EC2 cluster controller, etc). This will enable you to mock and test your EC2-based system more precisely.

For more information, please refer to the Technical Specifications.

Quick Start

git clone https://github.com/treelogic-swe/aws-mock.git
cd aws-mock
gradle jettyRun

That's all.

This will run a build that automatically downloads all dependencies and prepares the code for use, and then it will start a jetty server that runs aws-mock locally on your computer.

Now you are able to interact with your local, mock version of Amazon Web Services (though only EC2 for now), in your own client applications.

You can use AWS-SDK, or a number of other third-party client tools such as elasticfox.

To manage instances on mock EC2, just point to the custom EC2 endpoint as follows: http://localhost:8000/aws-mock/ec2-endpoint/ (equivalent to the official endpoint url https://ec2.us-west-1.amazonaws.com/)

For more usage instructions including how to extend aws-mock, please look into our full User's Guide.

For detailed specification and reference for those interfaces already available in aws-mock, here is a list of them: Implemented Requests and Responses.

API Documentation

Please find API documentation for all currently implemented interfaces at the link below. Don't worry about the word 'javadoc' โ€“ you don't have to write any Java, just pick your favorite JVM-targeting language (Clojure, Scala, JRuby, Jython, Groovy, etc.) and off you go. The aws-mock contributors commit to supporting Literate Programming in any JVM-targeting language you choose to use.

http://treelogic-swe.github.io/aws-mock/javadoc/

Tips

  • To build a war file for deployment, run gradle war.
  • Initially there are no mock instances in mock EC2, so you need to run one or more new instances first.
  • Your client doesn't need to provide valid credentials since aws-mock skips the secretKey/accessKey check.
  • There are a few options in src/main/resources/aws-mock.properties to tune.
  • For Eclipse users, gradle clean Eclipse eclipse will initialize the ready-to-import eclipse wtp project facets.

Your Contribution, in Any JVM-Targeting Language

Any contribution to aws-mock is strongly welcomed - including any adding of the unimplemented interfaces/data of EC2 and other mock of Amazon Web Services. If you find aws-mock helpful in working with your applications and have added features, we encourage you fork and send your pull requests to us! Bug reports are also very much appreciated.

Adding features to aws-mock is really easy, and you can do it in any JVM language you want. Please see the instructions.

License

aws-mock is released under version 2.0 of the Apache License.

aws-mock's People

Contributors

maxiaohao avatar nottoseethesun avatar deathspeeder avatar jayscrivner avatar xdoobx avatar

Watchers

Vaibhav avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.